Skip to content

Commit 989178d

Browse files
committed
fix examples
1 parent ff07b14 commit 989178d

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

examples/example09.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
try {
6464
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
65+
$html2pdf->getSecurityService()->addAllowedHost('html2pdf-dev.lxd');
6566
$html2pdf->writeHTML($content);
6667
$html2pdf->output('example09.pdf');
6768
exit;

src/Exception/ExceptionFormatter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ protected function buildTextMessage(Html2PdfException $e, $data)
121121

122122
if (!empty($data)) {
123123
foreach ($data as $key => $value) {
124-
$this->message .= ' '.ucwords($key).': '.trim($value)."\n";
124+
$this->message .= ' '.ucwords($key).': '.trim((string) $value)."\n";
125125
}
126126
}
127127
}
@@ -145,7 +145,7 @@ protected function buildHtmlMessage(Html2PdfException $e, $data)
145145

146146
if (!empty($data)) {
147147
foreach ($data as $key => $value) {
148-
$this->htmlMessage .= ' '.ucwords($key).': '.trim(htmlentities($value))."<br />\n";
148+
$this->htmlMessage .= ' '.ucwords($key).': '.trim(htmlentities((string) $value))."<br />\n";
149149
}
150150
}
151151
}

0 commit comments

Comments
 (0)