Fix unsupported /e modifier in preg_replace function call

This commit is contained in:
Kijin Sung 2015-12-08 14:10:28 +09:00
parent 6473115ed3
commit 41809cfb69

View file

@ -1200,7 +1200,7 @@ function removeSrcHack($match)
continue; continue;
} }
$val = preg_replace('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/e', 'chr("\\1"?0x00\\1:\\2+0)', $m[3][$idx] . $m[4][$idx]); $val = preg_replace_callback('/&#(?:x([a-fA-F0-9]+)|0*(\d+));/', function($n) {return chr($n[1] ? ('0x00' . $n[1]) : ($n[2] + 0)); }, $m[3][$idx] . $m[4][$idx]);
$val = preg_replace('/^\s+|[\t\n\r]+/', '', $val); $val = preg_replace('/^\s+|[\t\n\r]+/', '', $val);
if(preg_match('/^[a-z]+script:/i', $val)) if(preg_match('/^[a-z]+script:/i', $val))