mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ReplaceText
synced 2024-11-23 22:33:48 +00:00
Merge "Quote delimiter in target text when using regular expressions"
This commit is contained in:
commit
0480d83b71
|
@ -914,7 +914,8 @@ class SpecialReplaceText extends SpecialPage {
|
|||
|
||||
// Get all indexes
|
||||
if ( $use_regex ) {
|
||||
preg_match_all( "/$target/Uu", $text, $matches, PREG_OFFSET_CAPTURE );
|
||||
$targetq = str_replace( "/", "\\/", $target );
|
||||
preg_match_all( "/$targetq/Uu", $text, $matches, PREG_OFFSET_CAPTURE );
|
||||
} else {
|
||||
$targetq = preg_quote( $target, '/' );
|
||||
preg_match_all( "/$targetq/", $text, $matches, PREG_OFFSET_CAPTURE );
|
||||
|
|
Loading…
Reference in a new issue