mirror of
https://github.com/e107inc/e107.git
synced 2025-01-30 19:57:42 +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;
|
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)
|
function toText($text)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if($this->isHtml($text)==true)
|
||||||
|
{
|
||||||
|
$text = $this->toHtml($text,true);
|
||||||
|
$text = strip_tags($text);
|
||||||
|
}
|
||||||
|
|
||||||
$search = array("'", "$", "'", "$", "\", "\");
|
$search = array("'", "$", "'", "$", "\", "\");
|
||||||
$replace = array("'", '$', "'", '$', "\\", "\\");
|
$replace = array("'", '$', "'", '$', "\\", "\\");
|
||||||
$text = str_replace($search, $replace, $text);
|
$text = str_replace($search, $replace, $text);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user