1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 12:48:24 +01:00

Issue #1281 Include og:image meta for Page-Body content.

This commit is contained in:
Cameron 2016-01-27 12:05:15 -08:00
parent 21fdea06d4
commit 0182c92517
2 changed files with 23 additions and 3 deletions

View File

@ -2106,9 +2106,7 @@ class e_parse extends e_parser
$replace = array("'", '$', "'", '$', SITEURL, "href='".SITEURL."request.php", '', '' );
$text = str_replace($search, $replace, $text);
// Fix any left-over '&'
$text = str_replace('&', '&', $text); //first revert any previously converted.
$text = str_replace('&', '&', $text);
$text = $this->ampEncode($text);
if($tags == true && ($text))
{
@ -2119,6 +2117,21 @@ class e_parse extends e_parser
}
/**
* Clean and Encode Ampersands '&' for output to browser.
* @param string $text
* @return mixed|string
*/
function ampEncode($text='')
{
// Fix any left-over '&'
$text = str_replace('&', '&', $text); //first revert any previously converted.
$text = str_replace('&', '&', $text);
return $text;
}
/**
* Convert any string back to plain text.
* @param $text

View File

@ -654,6 +654,13 @@ class pageClass
e107::meta('og:image',$mimg);
}
$images = e107::getBB()->getContent('img',$this->pageText);
foreach($images as $im)
{
$im = $tp->ampEncode($im);
e107::meta('og:image',($im));
}
//return $ret;
}