mirror of
https://github.com/e107inc/e107.git
synced 2025-08-18 12:21:45 +02:00
Fixes #850 - Gallery missing description when using simple brackets. Fixes #607 - embedded English text.
This commit is contained in:
@@ -1857,16 +1857,17 @@ class e_parse extends e_parser
|
||||
return trim($ret_parser);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Use it on html attributes to avoid breaking markup .
|
||||
* @example echo "<a href='#' title='".$tp->toAttribute($text)."'>Hello</a>";
|
||||
*/
|
||||
function toAttribute($text)
|
||||
{
|
||||
// URLs posted without HTML access may have an & in them.
|
||||
$text = str_replace('&', '&', $text);
|
||||
// Xhtml compliance.
|
||||
$text = htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
|
||||
if(!preg_match('/&#|\'|"|\(|\)|<|>/s', $text))
|
||||
if(!preg_match('/&#|\'|"|<|>/s', $text))
|
||||
{
|
||||
$text = $this->replaceConstants($text);
|
||||
return $text;
|
||||
|
Reference in New Issue
Block a user