mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Fixed Meta-Tag overwrite issue. Changed eResponse to singleton. May correct problems with Facebook app-id and custom og:image. Pages possibly affected: front-page (index.php) and news, custom-page and user pages.
This commit is contained in:
@@ -163,7 +163,8 @@ if ($e_headers && is_array($e_headers))
|
|||||||
}
|
}
|
||||||
unset($e_headers);
|
unset($e_headers);
|
||||||
|
|
||||||
echo e107::getUrl()->response()->renderMeta()."\n"; // render all the e107::meta() entries.
|
// echo e107::getUrl()->response()->renderMeta()."\n"; // render all the e107::meta() entries.
|
||||||
|
echo e107::getSingleton('eResponse')->renderMeta()."\n";
|
||||||
|
|
||||||
echo "<title>".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME') ? PAGE_NAME.' - ' : "")).SITENAME."</title>\n\n";
|
echo "<title>".(defined('e_PAGETITLE') ? e_PAGETITLE.' - ' : (defined('PAGE_NAME') ? PAGE_NAME.' - ' : "")).SITENAME."</title>\n\n";
|
||||||
|
|
||||||
@@ -490,8 +491,15 @@ function render_meta($type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// legay meta-tag checks.
|
// legay meta-tag checks.
|
||||||
|
/*
|
||||||
$isKeywords = e107::getUrl()->response()->getMetaKeywords();
|
$isKeywords = e107::getUrl()->response()->getMetaKeywords();
|
||||||
$isDescription = e107::getUrl()->response()->getMetaDescription();
|
$isDescription = e107::getUrl()->response()->getMetaDescription();
|
||||||
|
*/
|
||||||
|
|
||||||
|
$isKeywords = e107::getSingleton('eResponse')->getMetaKeywords();
|
||||||
|
$isDescription = e107::getSingleton('eResponse')->getMetaDescription();
|
||||||
|
|
||||||
|
|
||||||
if(empty($isKeywords))
|
if(empty($isKeywords))
|
||||||
{
|
{
|
||||||
echo (defined("META_KEYWORDS")) ? "\n<meta name=\"keywords\" content=\"".$key_merge.META_KEYWORDS."\" />\n" : render_meta('keywords');
|
echo (defined("META_KEYWORDS")) ? "\n<meta name=\"keywords\" content=\"".$key_merge.META_KEYWORDS."\" />\n" : render_meta('keywords');
|
||||||
|
@@ -389,7 +389,8 @@ class eFront
|
|||||||
$router = new eRouter();
|
$router = new eRouter();
|
||||||
$this->setRouter($router);
|
$this->setRouter($router);
|
||||||
|
|
||||||
$response = new eResponse();
|
// $response = new eResponse();
|
||||||
|
$response = e107::getSingleton('eResponse');
|
||||||
$this->setResponse($response);
|
$this->setResponse($response);
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
@@ -2276,17 +2276,20 @@ class e107
|
|||||||
*/
|
*/
|
||||||
public static function meta($name = null, $content = null, $extended = array())
|
public static function meta($name = null, $content = null, $extended = array())
|
||||||
{
|
{
|
||||||
|
$response = self::getSingleton('eResponse');
|
||||||
|
|
||||||
if($name === 'description')
|
if($name === 'description')
|
||||||
{
|
{
|
||||||
self::getUrl()->response()->addMetaDescription($content); //Cam: TBD
|
$response->addMetaDescription($content); //Cam: TBD
|
||||||
}
|
}
|
||||||
|
|
||||||
if($name === 'keywords')
|
if($name === 'keywords')
|
||||||
{
|
{
|
||||||
self::getUrl()->response()->addMetaKeywords($content); //Cam: TBD
|
$response->addMetaKeywords($content); //Cam: TBD
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::getUrl()->response()->addMeta($name, $content, $extended);
|
return $response->addMeta($name, $content, $extended);
|
||||||
|
// return self::getUrl()->response()->addMeta($name, $content, $extended);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -234,7 +234,8 @@ class social_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
$defaultUrl = vartrue($this->var['url'], e_REQUEST_URL);
|
$defaultUrl = vartrue($this->var['url'], e_REQUEST_URL);
|
||||||
$defaultTitle = vartrue($this->var['title'], deftrue('e_PAGETITLE'). " | ". SITENAME);
|
$defaultTitle = vartrue($this->var['title'], deftrue('e_PAGETITLE'). " | ". SITENAME);
|
||||||
$defaultDiz = vartrue($this->var['description'], e107::getUrl()->response()->getMetaDescription());
|
// $defaultDiz = vartrue($this->var['description'], e107::getUrl()->response()->getMetaDescription());
|
||||||
|
$defaultDiz = vartrue($this->var['description'], e107::getSingleton('eResponse')->getMetaDescription());
|
||||||
$defaultTags = vartrue($this->var['tags'],'');
|
$defaultTags = vartrue($this->var['tags'],'');
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
Reference in New Issue
Block a user