Index: trunk/extensions/AbuseFilter/AbuseFilter.parser.php |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | $str = $str->toString(); |
154 | 154 | $pattern = $regex->toString(); |
155 | 155 | |
156 | | - $needle = strtr( $needle, array('\/' => '\/', '/' => '\/') ); |
| 156 | + $pattern = preg_replace( '!(\\\\\\\\)*(\\\\)?/!', '$1\/', $pattern ); |
157 | 157 | $pattern = "/$pattern/u"; |
158 | 158 | |
159 | 159 | wfSuppressWarnings(); |
— | — | @@ -1107,7 +1107,7 @@ |
1108 | 1108 | $haystack = $args[1]->toString(); |
1109 | 1109 | |
1110 | 1110 | ## Munge the regex |
1111 | | - $needle = strtr( $needle, array('\/' => '\/', '/' => '\/') ); |
| 1111 | + $needle = preg_replace( '!(\\\\\\\\)*(\\\\)?/!', '$1\/', $needle ); |
1112 | 1112 | $needle = "/$needle/u"; |
1113 | 1113 | |
1114 | 1114 | $count = 0; |