1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-16 19:44:09 +02:00

Fix for <title> tag containing single or double quotes. Tests added.

This commit is contained in:
Cameron
2021-11-03 13:55:56 -07:00
parent 6d5b4f5c3a
commit 54cb89b87d
2 changed files with 276 additions and 2 deletions

View File

@@ -4473,8 +4473,14 @@ class eResponse
$meta = '_' . $meta;
if(isset($this->$meta) && !empty($content))
{
$content = str_replace(array('&amp;', '"', "'"), array('&', '', ''), $content);
$this->{$meta}[] = htmlspecialchars((string) $content, ENT_QUOTES, 'UTF-8');
$content = str_replace('&amp;', '&', $content);
if($meta !== '_e_PAGETITLE')
{
$content = htmlspecialchars((string) $content, ENT_QUOTES, 'UTF-8');
}
$this->{$meta}[] = $content;
}
return $this;
}
@@ -4518,6 +4524,8 @@ class eResponse
$this->_e_PAGETITLE = array();
}
$title = str_replace(['&#39;','&#039;'], "'", $title);
return $this->addMetaData('e_PAGETITLE', $title);
}