mirror of
https://github.com/e107inc/e107.git
synced 2025-01-29 10:38:08 +01:00
toText() method now strips HTML correctly.
This commit is contained in:
parent
590df058b3
commit
f89ff13572
@ -1976,9 +1976,21 @@ class e_parse extends e_parser
|
||||
return $text;
|
||||
}
|
||||
|
||||
//Convert specific characters back to original form, for use in storing code (or regex) values in the db.
|
||||
|
||||
/**
|
||||
* Convert any string back to plain text.
|
||||
* @param $text
|
||||
* @return mixed|string
|
||||
*/
|
||||
function toText($text)
|
||||
{
|
||||
|
||||
if($this->isHtml($text)==true)
|
||||
{
|
||||
$text = $this->toHtml($text,true);
|
||||
$text = strip_tags($text);
|
||||
}
|
||||
|
||||
$search = array("'", "$", "'", "$", "\", "\");
|
||||
$replace = array("'", '$', "'", '$', "\\", "\\");
|
||||
$text = str_replace($search, $replace, $text);
|
||||
|
Loading…
x
Reference in New Issue
Block a user