1
0
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:
Cameron 2015-06-07 18:16:06 -07:00
parent 590df058b3
commit f89ff13572

View File

@ -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);