make valid filenames
This commit is contained in:
parent
a6e09a7f95
commit
471d78986f
@ -199,10 +199,18 @@ abstract class pdfdocumentsGeneric extends Base implements genericInterface
|
|||||||
{
|
{
|
||||||
// forced filename from setFilename()
|
// forced filename from setFilename()
|
||||||
if ($this->filename) {
|
if ($this->filename) {
|
||||||
return $this->addFilenameExtension($this->filename);
|
return $this->addFilenameExtension(
|
||||||
|
$this->makeValidFileName(
|
||||||
|
$this->filename
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->addFilenameExtension($this->getTypeForFilename());
|
return $this->addFilenameExtension(
|
||||||
|
$this->makeValidFileName(
|
||||||
|
$this->getTypeForFilename()
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -69,19 +69,25 @@ abstract class pdfdocumentsOrder extends pdfdocumentsGeneric implements orderInt
|
|||||||
{
|
{
|
||||||
// forced filename from setFilename()
|
// forced filename from setFilename()
|
||||||
if ($this->filename) {
|
if ($this->filename) {
|
||||||
return $this->addFilenameExtension($this->filename);
|
return $this->addFilenameExtension(
|
||||||
|
$this->makeValidFileName(
|
||||||
|
$this->filename
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$sTrimmedBillName = trim($this->getOrder()->getFieldData('oxbilllname'));
|
$sTrimmedBillName = trim($this->getOrder()->getFieldData('oxbilllname'));
|
||||||
|
|
||||||
return $this->addFilenameExtension(
|
return $this->addFilenameExtension(
|
||||||
implode(
|
$this->makeValidFileName(
|
||||||
'_',
|
implode(
|
||||||
[
|
'_',
|
||||||
$this->getTypeForFilename(),
|
[
|
||||||
$this->getOrder()->getFieldData('oxordernr'),
|
$this->getTypeForFilename(),
|
||||||
$sTrimmedBillName
|
$this->getOrder()->getFieldData('oxordernr'),
|
||||||
]
|
$sTrimmedBillName
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -111,10 +111,12 @@ class invoicePdf extends pdfdocumentsOrder implements pdfdocumentsOrderinvoiceIn
|
|||||||
{
|
{
|
||||||
$filename = parent::getFilename();
|
$filename = parent::getFilename();
|
||||||
|
|
||||||
return str_replace(
|
$filename = str_replace(
|
||||||
$this->getOrder()->getFieldData('oxordernr'),
|
$this->getOrder()->getFieldData('oxordernr'),
|
||||||
$this->getOrder()->getFieldData('oxbillnr'),
|
$this->getOrder()->getFieldData('oxbillnr'),
|
||||||
$filename
|
$filename
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return $this->makeValidFileName($filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user