From f2baa0626df80d6ab0cade2f5500a6b4f6227e66 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Tue, 23 Jun 2009 22:10:46 +0000 Subject: [PATCH] Pass delimiter to preg_quote(). Props Denis-de-Bernardy. see #9955 git-svn-id: https://develop.svn.wordpress.org/trunk@11634 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 4 ++-- wp-includes/functions.php | 2 +- xmlrpc.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 7c42bbf210..53cfeeae89 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -80,8 +80,8 @@ function wptexturize($text) { } function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') { - $o = preg_quote($opening); - $c = preg_quote($closing); + $o = preg_quote($opening, '/'); + $c = preg_quote($closing, '/'); foreach($disabled_elements as $element) { if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element); if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 03019a807c..2f77ecd7ef 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2682,7 +2682,7 @@ function smilies_init() { } else { $wp_smiliessearch .= '|'; } - $wp_smiliessearch .= preg_quote($rest); + $wp_smiliessearch .= preg_quote($rest, '/'); } $wp_smiliessearch .= ')(?:\s|$)/m'; diff --git a/xmlrpc.php b/xmlrpc.php index 85d3a4ed84..d8f5fc8a95 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -3300,7 +3300,7 @@ class wp_xmlrpc_server extends IXR_Server { $p = explode( "\n\n", $linea ); - $preg_target = preg_quote($pagelinkedto); + $preg_target = preg_quote($pagelinkedto, '|'); foreach ( $p as $para ) { 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 = strip_tags($excerpt, ''); // strip all tags but our context marker $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 = strip_tags($excerpt); // YES, again, to remove the marker wrapper break;