preg replace - PHP preg_replace error wordpress -
i have following wordpress code
function shortcode_parse_atts($text) { $atts = array(); $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\s+)(?:\s|$)/'; $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); if ( preg_match_all($pattern, $text, $match, preg_set_order) ) { foreach ($match $m) { if (!empty($m[1])) $atts[strtolower($m[1])] = stripcslashes($m[2]); elseif (!empty($m[3])) $atts[strtolower($m[3])] = stripcslashes($m[4]); elseif (!empty($m[5])) $atts[strtolower($m[5])] = stripcslashes($m[6]); elseif (isset($m[7]) , strlen($m[7])) $atts[] = stripcslashes($m[7]); elseif (isset($m[8])) $atts[] = stripcslashes($m[8]); } } else { $atts = ltrim($text); } return $atts; }
after execute function path, error:
warning: preg_replace() [function.preg-replace]: compilation failed: unknown option bit(s) set @ offset -1 in /path/wp-includes/shortcodes.php on line 258
line 258 marked here
$text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text); //<--- line 258
can provide this?
would appreciated
cant downgrade php version...
that happens because pcre outdated. after updating php 5.3 version, need manually update pcre of server.
run following code in ssh:
pcretest -c
it show version running of it. last version 8.32.
here relation of pcre version should use each php version: http://php.net/manual/en/pcre.installation.php
Comments
Post a Comment