1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 17:14:42 +02:00

Issue #4783 Site name was still being appended to the <title> tag. Site name has now been removed when using news_meta_title.

This commit is contained in:
Cameron
2022-06-06 19:15:41 -07:00
parent 94bf1efda2
commit 08eb2a37d9
4 changed files with 47 additions and 21 deletions

View File

@@ -4093,7 +4093,8 @@ class eResponse
{
protected $_body = array('default' => '');
protected $_title = array('default' => array());
protected $_e_PAGETITLE = array();
protected $_e_PAGETITLE = array(); // partial <title> tag.
protected $_e_PAGETITLE_OVERRIDE = array(); // Full <title> tag
protected $_META_DESCRIPTION = array();
protected $_META_KEYWORDS = array();
protected $_render_mod = array('default' => 'default');
@@ -4600,7 +4601,7 @@ class eResponse
{
$content = str_replace('&amp;', '&', $content);
if($meta !== '_e_PAGETITLE')
if($meta !== '_e_PAGETITLE' && $meta !== '_e_PAGETITLE_OVERRIDE')
{
$content = htmlspecialchars((string) $content, ENT_QUOTES, 'UTF-8');
}
@@ -4642,23 +4643,40 @@ class eResponse
* @param string $title
* @return eResponse
*/
public function addMetaTitle($title, $reset=false)
public function addMetaTitle($title, $reset=false, $override=false)
{
if($reset)
{
$this->_e_PAGETITLE = array();
if($override)
{
$this->_e_PAGETITLE_OVERRIDE = array();
}
else
{
$this->_e_PAGETITLE = array();
}
}
$title = str_replace(['&#39;','&#039;'], "'", $title);
if($override)
{
return $this->addMetaData('e_PAGETITLE_OVERRIDE', $title);
}
return $this->addMetaData('e_PAGETITLE', $title);
}
/**
* @return string
*/
public function getMetaTitle()
public function getMetaTitle($override = false)
{
if($override)
{
return $this->getMetaData('e_PAGETITLE_OVERRIDE', $this->_meta_title_separator);
}
return $this->getMetaData('e_PAGETITLE', $this->_meta_title_separator);
}