1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 23:26:41 +02:00

Fixes to keep Facebook Open-Graph happy.

This commit is contained in:
Cameron
2015-07-20 23:18:08 -07:00
parent af4bb201b1
commit 3cb6c44231

View File

@@ -3680,6 +3680,8 @@ class eResponse
protected $_META_KEYWORDS = array(); protected $_META_KEYWORDS = array();
protected $_render_mod = array('default' => 'default'); protected $_render_mod = array('default' => 'default');
protected $_meta_title_separator = ' - '; protected $_meta_title_separator = ' - ';
protected $_meta_name_only = array('keywords', 'viewport'); // Keep FB happy.
protected $_meta_property_only = array('article:section', 'article:tag'); // Keep FB happy.
protected $_meta = array(); protected $_meta = array();
protected $_title_separator = ' » '; protected $_title_separator = ' » ';
protected $_content_type = 'html'; protected $_content_type = 'html';
@@ -3972,9 +3974,16 @@ class eResponse
{ {
// $key = (substr($name,0,3) == 'og:') ? 'property' : 'name'; // $key = (substr($name,0,3) == 'og:') ? 'property' : 'name';
// $attr[$key] = $name; // $attr[$key] = $name;
if(!in_array($name, $this->_meta_name_only))
{
$attr['property'] = $name; // giving both should be valid and avoid issues with FB and others. $attr['property'] = $name; // giving both should be valid and avoid issues with FB and others.
}
if(!in_array($name, $this->_meta_property_only))
{
$attr['name'] = $name; $attr['name'] = $name;
} }
}