1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-08 07:36:32 +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';
@@ -3692,7 +3694,7 @@ class eResponse
'rss' => 'application/rss+xml', 'rss' => 'application/rss+xml',
'soap' => 'application/soap+xml', 'soap' => 'application/soap+xml',
); );
protected $_params = array( protected $_params = array(
'render' => true, 'render' => true,
'meta' => false, 'meta' => false,
@@ -3972,8 +3974,15 @@ class eResponse
{ {
// $key = (substr($name,0,3) == 'og:') ? 'property' : 'name'; // $key = (substr($name,0,3) == 'og:') ? 'property' : 'name';
// $attr[$key] = $name; // $attr[$key] = $name;
$attr['property'] = $name; // giving both should be valid and avoid issues with FB and others. if(!in_array($name, $this->_meta_name_only))
$attr['name'] = $name; {
$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;
}
} }