Skip to content
Snippets Groups Projects

Issue #3355499: Fix PHP8 deprecated function warnings.

1 file
+ 8
7
Compare changes
  • Side-by-side
  • Inline
+ 8
7
@@ -512,8 +512,10 @@ class PdfTemplate extends FPDI {
// Bugfix if you like to print some html code to the PDF, we
// need to prevent the replacement of this tags.
$content = str_replace('>', '>', $content);
$content = str_replace('<', '<', $content);
if (!empty($content)) {
$content = str_replace('>', '>', $content);
$content = str_replace('<', '<', $content);
}
$content = $this->hyphenateText($content, $hyphen_patterns);
}
@@ -626,7 +628,7 @@ class PdfTemplate extends FPDI {
$this->lastWritingPage = $this->getPage();
if ($stripHTML) {
$content = html_entity_decode(strip_tags($content), ENT_QUOTES | ENT_HTML401);
$content = html_entity_decode(strip_tags((string) $content), ENT_QUOTES | ENT_HTML401);
}
// Write the content of a field to the pdf file:
@@ -937,7 +939,7 @@ class PdfTemplate extends FPDI {
/**
* This method adds a new page to the PDF.
*/
public function addPage($orientation = '', $format = '', $keepmargins = false, $tocpage = false, $path = NULL, $reset = FALSE, $numbering = 'main') {
public function addPage($orientation = '', $format = [], $keepmargins = false, $tocpage = false, $path = NULL, $reset = FALSE, $numbering = 'main') {
// Do not add any new page, if we are writing
// in the footer or header.
@@ -966,7 +968,6 @@ class PdfTemplate extends FPDI {
$files[] = array('path' => $path, 'numbering' => $numbering);
}
$format = FALSE;
foreach ($files as $file) {
if (!empty($file['path']) && file_exists($file['path'])) {
$path = realpath($file['path']);
@@ -983,7 +984,7 @@ class PdfTemplate extends FPDI {
$page = $this->importPage($index);
// ajust the page format (only for the first template)
if ($format == FALSE) {
if (empty($format)) {
$dim = $this->getTemplateSize($index);
$format[0] = $dim['w'];
@@ -1005,7 +1006,7 @@ class PdfTemplate extends FPDI {
}
// if all paths were empty, ensure that at least the page is added
if ($format == FALSE) {
if (empty($format)) {
parent::addPage();
$this->setPageFormat($this->defaultFormat, $this->defaultOrientation);
}
Loading