Pass delimiter to preg_quote(). Props Denis-de-Bernardy. see #9955
git-svn-id: http://svn.automattic.com/wordpress/trunk@11634 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
75c820b140
commit
c6838b1761
|
@ -80,8 +80,8 @@ function wptexturize($text) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
|
function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
|
||||||
$o = preg_quote($opening);
|
$o = preg_quote($opening, '/');
|
||||||
$c = preg_quote($closing);
|
$c = preg_quote($closing, '/');
|
||||||
foreach($disabled_elements as $element) {
|
foreach($disabled_elements as $element) {
|
||||||
if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element);
|
if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element);
|
||||||
if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) {
|
if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) {
|
||||||
|
|
|
@ -2682,7 +2682,7 @@ function smilies_init() {
|
||||||
} else {
|
} else {
|
||||||
$wp_smiliessearch .= '|';
|
$wp_smiliessearch .= '|';
|
||||||
}
|
}
|
||||||
$wp_smiliessearch .= preg_quote($rest);
|
$wp_smiliessearch .= preg_quote($rest, '/');
|
||||||
}
|
}
|
||||||
|
|
||||||
$wp_smiliessearch .= ')(?:\s|$)/m';
|
$wp_smiliessearch .= ')(?:\s|$)/m';
|
||||||
|
|
|
@ -3300,7 +3300,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
|
|
||||||
$p = explode( "\n\n", $linea );
|
$p = explode( "\n\n", $linea );
|
||||||
|
|
||||||
$preg_target = preg_quote($pagelinkedto);
|
$preg_target = preg_quote($pagelinkedto, '|');
|
||||||
|
|
||||||
foreach ( $p as $para ) {
|
foreach ( $p as $para ) {
|
||||||
if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
|
if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
|
||||||
|
@ -3322,7 +3322,7 @@ class wp_xmlrpc_server extends IXR_Server {
|
||||||
$excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
|
$excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
|
||||||
$excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker
|
$excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker
|
||||||
$excerpt = trim($excerpt);
|
$excerpt = trim($excerpt);
|
||||||
$preg_marker = preg_quote($marker);
|
$preg_marker = preg_quote($marker, '|');
|
||||||
$excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
|
$excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
|
||||||
$excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
|
$excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue