[pLog-svn] r7241 - plog/branches/lifetype-1.2/class/data
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Wed Jul 15 06:57:35 EDT 2020
Author: jondaley
Date: 2020-07-15 06:57:35 -0400 (Wed, 15 Jul 2020)
New Revision: 7241
Modified:
plog/branches/lifetype-1.2/class/data/kses.class.php
Log:
more my_preg_replace -> preg_replace_callback changes; found a bug in PHP7 _split() but haven't tracked it down yet
Modified: plog/branches/lifetype-1.2/class/data/kses.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/kses.class.php 2020-07-15 10:38:55 UTC (rev 7240)
+++ plog/branches/lifetype-1.2/class/data/kses.class.php 2020-07-15 10:57:35 UTC (rev 7241)
@@ -247,8 +247,8 @@
$string = preg_replace("/(\s+)(>)(\s+)/", "\\1>\\3", $string );
// also, normalize whatever is within <code>...</code> tags but only in the "xhtml converter" mode
- // TODO: need to check this one
- $string = my_preg_replace("/(.*<code>)(.*)(<\/code>.*)/e", '"\\1".$this->_tmp("\\2")."\\3"', $string );
+ $string = preg_replace_callback("/(.*<code>)(.*)(<\/code>.*)/",
+ function($m){ return $m[1].$this->_tmp($m[2]).$m[3]; }, $string );
}
return $string;
@@ -754,9 +754,10 @@
###############################################################################
function _decode_entities($string)
{
- $string = preg_replace('/&#([0-9]+);/e', 'chr("\\1")', $string);
- // TODO: need to check this
- $string = my_preg_replace('/&#[Xx]([0-9A-Fa-f]+);/e', 'chr(hexdec("\\1"))', $string);
+ $string = preg_replace_callback('/&#([0-9]+);/',
+ function($m) { return chr($m[1]); }, $string);
+ $string = preg_replace_callback('/&#[Xx]([0-9A-Fa-f]+);/',
+ function($m) { return chr(hexdec($m[1])); }, $string);
return $string;
} # function _decode_entities
More information about the pLog-svn
mailing list