Skip to content

Commit 31eb7a7

Browse files
committed
PHP 8.1 > Fix some more null on string parameter
1 parent 76d3c7d commit 31eb7a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/config/sfViewConfigHandler.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ protected function addHtmlHead($viewName = '')
223223

224224
foreach ($this->mergeConfigValue('metas', $viewName) as $name => $content)
225225
{
226-
$data[] = sprintf(" \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', htmlspecialchars($content, ENT_QUOTES, sfConfig::get('sf_charset')))));
226+
$data[] = sprintf(" \$response->addMeta('%s', '%s', false, false);", $name, str_replace('\'', '\\\'', preg_replace('/&(?=\w+;)/', '&', htmlspecialchars((string) $content, ENT_QUOTES, sfConfig::get('sf_charset')))));
227227
}
228228

229229
return implode("\n", $data)."\n";

lib/request/sfWebRequest.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public function getContentType($trim = true)
192192
{
193193
$contentType = $this->getHttpHeader('Content-Type', null);
194194

195-
if ($trim && false !== $pos = strpos($contentType, ';'))
195+
if ($trim && false !== $pos = strpos((string) $contentType, ';'))
196196
{
197197
$contentType = substr($contentType, 0, $pos);
198198
}

0 commit comments

Comments
 (0)