Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php |
— | — | @@ -282,16 +282,14 @@ |
283 | 283 | */ |
284 | 284 | function cmpCallback( $a, $b, $operator ) { |
285 | 285 | $b = html_entity_decode( $b, ENT_QUOTES ); |
286 | | - $bre = str_replace( '/', '\/', $b ); |
287 | | - $bre = str_replace( '(', '\(', $bre ); |
288 | | - $bre = str_replace( ')', '\)', $bre ); |
| 286 | + $bre = preg_quote( $b, '|' ); |
289 | 287 | switch ( $operator ) { |
290 | 288 | case '=': |
291 | | - $cond = preg_match( "/$bre/i", $a ); |
| 289 | + $cond = preg_match( "|$bre|i", $a ); |
292 | 290 | break; |
293 | 291 | |
294 | 292 | case '!=': |
295 | | - $cond = !preg_match( "/$bre/i", $a ); |
| 293 | + $cond = !preg_match( "|$bre|i", $a ); |
296 | 294 | break; |
297 | 295 | |
298 | 296 | default: |
— | — | @@ -616,9 +614,7 @@ |
617 | 615 | $html = preg_replace( "|(<option[^<>]*) selected|i", "$1", $html ); # remove the currently selected option |
618 | 616 | if( $v ) { |
619 | 617 | foreach( self::split( $v ) as $v ) { |
620 | | - $v = htmlentities( $v ); |
621 | | - $v = str_replace( '(', '\(', $v ); |
622 | | - $v = str_replace( ')', '\)', $v ); |
| 618 | + $v = preg_quote( htmlentities( $v ), '|' ); |
623 | 619 | $html = preg_match( "|<option[^>]+value\s*=|is", $html ) |
624 | 620 | ? preg_replace( "|(<option)([^>]+value\s*=\s*[\"']{$v}['\"])|is", "$1 selected$2", $html ) |
625 | 621 | : preg_replace( "|(<option[^>]*)(?=>$v</option>)|is", "$1 selected", $html ); |
Index: trunk/extensions/RecordAdmin/RecordAdmin.php |
— | — | @@ -10,7 +10,7 @@ |
11 | 11 | * @author Siebrand Mazeland |
12 | 12 | * @licence GNU General Public Licence 2.0 or later |
13 | 13 | */ |
14 | | -define( 'RECORDADMIN_VERSION', '1.2.7, 2011-07-12' ); |
| 14 | +define( 'RECORDADMIN_VERSION', '1.2.8, 2011-07-13' ); |
15 | 15 | |
16 | 16 | $dir = dirname( __FILE__ ) . '/'; |
17 | 17 | $wgExtensionMessagesFiles['RecordAdmin'] = $dir . 'RecordAdmin.i18n.php'; |