Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/config/sfViewConfigHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ protected function addHtmlHead($viewName = '')

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

return implode("\n", $data)."\n";
Expand Down
5 changes: 4 additions & 1 deletion lib/controller/sfController.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ protected function getController($moduleName, $controllerName, $extension)
$classSuffix = ucfirst(strtolower($extension));
if (!isset($this->controllerClasses[$moduleName.'_'.$controllerName.'_'.$classSuffix]))
{
$this->controllerExists($moduleName, $controllerName, $extension, true);
if (!$this->controllerExists($moduleName, $controllerName, $extension, true))
{
return null;
}
}

$class = $this->controllerClasses[$moduleName.'_'.$controllerName.'_'.$classSuffix];
Expand Down
3 changes: 2 additions & 1 deletion lib/escaper/sfOutputEscaperArrayDecorator.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ public function offsetExists($offset)
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return sfOutputEscaper::escape($this->escapingMethod, $this->value[$offset]);
$value = isset($this->value[$offset]) ? $this->value[$offset] : null;
return sfOutputEscaper::escape($this->escapingMethod, $value);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/request/sfWebRequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function getContentType($trim = true)
{
$contentType = $this->getHttpHeader('Content-Type', null);

if ($trim && false !== $pos = strpos($contentType, ';'))
if ($trim && false !== $pos = strpos((string) $contentType, ';'))
{
$contentType = substr($contentType, 0, $pos);
}
Expand Down
3 changes: 2 additions & 1 deletion lib/response/sfWebResponse.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,8 @@ public function sendHttpHeaders()
// cookies
foreach ($this->cookies as $cookie)
{
setrawcookie($cookie['name'], $cookie['value'], $cookie['expire'], $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httpOnly']);
$expire = isset($cookie['expire']) ? $cookie['expire'] : 0;
setrawcookie($cookie['name'], $cookie['value'], $expire, $cookie['path'], $cookie['domain'], $cookie['secure'], $cookie['httpOnly']);

if ($this->options['logging'])
{
Expand Down