1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 03:40:37 +02:00

e_parse small corrections, header keywords updated

This commit is contained in:
secretr
2010-02-12 16:37:42 +00:00
parent bad780c356
commit 700def686f

View File

@@ -8,10 +8,8 @@
* *
* Text processing and parsing functions * Text processing and parsing functions
* *
* $Source: /cvs_backup/e107_0.8/e107_handlers/e_parse_class.php,v $ * $URL$
* $Revision$ * $Id$
* $Date$
* $Author$
* *
*/ */
@@ -490,38 +488,39 @@ class e_parse
//Fix - sanitize keys as well //Fix - sanitize keys as well
$ret[$this->toDB($key, $nostrip, $no_encode, $mod, $original_author)] = $this->toDB($var, $nostrip, $no_encode, $mod, $original_author); $ret[$this->toDB($key, $nostrip, $no_encode, $mod, $original_author)] = $this->toDB($var, $nostrip, $no_encode, $mod, $original_author);
} }
return $ret;
}
if (MAGIC_QUOTES_GPC == TRUE && $nostrip == FALSE)
{
$data = stripslashes($data);
}
if (isset($pref['post_html']) && check_class($pref['post_html']))
{
$no_encode = TRUE;
}
if (is_numeric($original_author) && !check_class($pref['post_html'], '', $original_author))
{
$no_encode = FALSE;
}
if ($no_encode === TRUE && strpos($mod, 'no_html') === FALSE)
{
$search = array('$', '"', "'", '\\', '<?');
$replace = array('&#036;', '&quot;', '&#039;', '&#092;', '&lt;?');
$ret = str_replace($search, $replace, $data);
} }
else else
{ {
if (MAGIC_QUOTES_GPC == TRUE && $nostrip == FALSE) $data = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
{ $data = str_replace('\\', '&#092;', $data);
$data = stripslashes($data);
} $ret = preg_replace("/&amp;#(\d*?);/", "&#\\1;", $data);
if (isset($pref['post_html']) && check_class($pref['post_html']))
{
$no_encode = TRUE;
}
if (is_numeric($original_author) && !check_class($pref['post_html'], '', $original_author))
{
$no_encode = FALSE;
}
if ($no_encode === TRUE && strpos($mod, 'no_html') === FALSE)
{
$search = array('$', '"', "'", '\\', '<?');
$replace = array('&#036;', '&quot;', '&#039;', '&#092;', '&lt;?');
$ret = str_replace($search, $replace, $data);
}
else
{
$data = htmlspecialchars($data, ENT_QUOTES, 'UTF-8');
$data = str_replace('\\', '&#092;', $data);
$ret = preg_replace("/&amp;#(\d*?);/", "&#\\1;", $data);
}
if (strpos($mod, 'no_php') !== FALSE)
{
$ret = str_replace(array("[php]", "[/php]"), array("&#91;php&#93;", "&#91;/php&#93;"), $ret);
}
} }
if (strpos($mod, 'no_php') !== FALSE)
{
$ret = str_replace(array("[php]", "[/php]"), array("&#91;php&#93;", "&#91;/php&#93;"), $ret);
}
return $ret; return $ret;
} }