mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 21:21:54 +02:00
Issue #1281 Include og:image meta for Page-Body content.
This commit is contained in:
parent
21fdea06d4
commit
0182c92517
@ -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
|
||||
|
7
page.php
7
page.php
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user