Skip to content

Commit f2baa06

Browse files
committed
Pass delimiter to preg_quote(). Props Denis-de-Bernardy. see WordPress#9955
git-svn-id: https://develop.svn.wordpress.org/trunk@11634 602fd350-edb4-49c9-b593-d223f7449a82
1 parent b545237 commit f2baa06

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

wp-includes/formatting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ function wptexturize($text) {
8080
}
8181

8282
function wptexturize_pushpop_element($text, &$stack, $disabled_elements, $opening = '<', $closing = '>') {
83-
$o = preg_quote($opening);
84-
$c = preg_quote($closing);
83+
$o = preg_quote($opening, '/');
84+
$c = preg_quote($closing, '/');
8585
foreach($disabled_elements as $element) {
8686
if (preg_match('/^'.$o.$element.'\b/', $text)) array_push($stack, $element);
8787
if (preg_match('/^'.$o.'\/'.$element.$c.'/', $text)) {

wp-includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,7 @@ function smilies_init() {
26822682
} else {
26832683
$wp_smiliessearch .= '|';
26842684
}
2685-
$wp_smiliessearch .= preg_quote($rest);
2685+
$wp_smiliessearch .= preg_quote($rest, '/');
26862686
}
26872687

26882688
$wp_smiliessearch .= ')(?:\s|$)/m';

xmlrpc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,7 +3300,7 @@ function pingback_ping($args) {
33003300

33013301
$p = explode( "\n\n", $linea );
33023302

3303-
$preg_target = preg_quote($pagelinkedto);
3303+
$preg_target = preg_quote($pagelinkedto, '|');
33043304

33053305
foreach ( $p as $para ) {
33063306
if ( strpos($para, $pagelinkedto) !== false ) { // it exists, but is it a link?
@@ -3322,7 +3322,7 @@ function pingback_ping($args) {
33223322
$excerpt= str_replace($context[0], $marker, $excerpt); // swap out the link for our marker
33233323
$excerpt = strip_tags($excerpt, '<wpcontext>'); // strip all tags but our context marker
33243324
$excerpt = trim($excerpt);
3325-
$preg_marker = preg_quote($marker);
3325+
$preg_marker = preg_quote($marker, '|');
33263326
$excerpt = preg_replace("|.*?\s(.{0,100}$preg_marker.{0,100})\s.*|s", '$1', $excerpt);
33273327
$excerpt = strip_tags($excerpt); // YES, again, to remove the marker wrapper
33283328
break;

0 commit comments

Comments
 (0)