Index: trunk/extensions/RegexFunctions/RegexFunctions.php |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | 'name' => 'RegexFunctions', |
18 | 18 | 'author' => 'Ryan Schmidt', |
19 | 19 | 'url' => 'http://www.mediawiki.org/wiki/Extension:RegexFunctions', |
20 | | - 'version' => '1.2', |
| 20 | + 'version' => '1.3', |
21 | 21 | 'description' => 'Regular Expression parser functions', |
22 | 22 | 'descriptionmsg' => 'regexfunctions-desc', |
23 | 23 | ); |
— | — | @@ -123,7 +123,7 @@ |
124 | 124 | //santizes a regex pattern |
125 | 125 | function sanitize($pattern, $m = false, $e = false) { |
126 | 126 | if(preg_match('/^\/(.*)([^\\\\])\/(.*?)$/', $pattern, $matches)) { |
127 | | - $pat = preg_replace('/([^\\\\])?\(\?(.*)(\:.*)?\)/Ue', '\'$1(?\' . $this->cleanupInternal(\'$2\') . \'$3)\'', $matches[1] . $matches[2]); |
| 127 | + $pat = preg_replace('/([^\\\\])?\(\?(.*\:)?(.*)\)/Ue', '\'$1(?\' . $this->cleanupInternal(\'$2\') . \'$3)\'', $matches[1] . $matches[2]); |
128 | 128 | $ret = '/' . $pat . '/'; |
129 | 129 | if($m) { |
130 | 130 | $mod = ''; |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | $ret .= $mod; |
138 | 138 | } |
139 | 139 | } else { |
140 | | - $pat = preg_replace('/([^\\\\])?\(\?(.*)(\:.*)?\)/Ue', '\'$1(?\' . $this->cleanupInternal(\'$2\') . \'$3)\'', $pattern); |
| 140 | + $pat = preg_replace('/([^\\\\])?\(\?(.*\:)?(.*)\)/Ue', '\'$1(?\' . $this->cleanupInternal(\'$2\') . \'$3)\'', $pattern); |
141 | 141 | $pat = preg_replace('!([^\\\\])/!', '$1\\/', $pat); |
142 | 142 | $ret = '/' . $pat . '/'; |
143 | 143 | } |