r91948 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91947‎ | r91948 | r91949 >
Date:11:51, 12 July 2011
Author:nad
Status:deferred
Tags:
Comment:
escpate brackets for regex use in populateForm too
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -616,7 +616,9 @@
617617 $html = preg_replace( "|(<option[^<>]*) selected|i", "$1", $html ); # remove the currently selected option
618618 if( $v ) {
619619 foreach( self::split( $v ) as $v ) {
620 - $v = htmlentities( preg_replace( "|([\[\]\|\\\(\)])|", "\\$1", $v ) );
 620+ $v = htmlentities( $v );
 621+ $v = str_replace( '(', '\(', $v );
 622+ $v = str_replace( ')', '\)', $v );
621623 $html = preg_match( "|<option[^>]+value\s*=|is", $html )
622624 ? preg_replace( "|(<option)([^>]+value\s*=\s*[\"']{$v}['\"])|is", "$1 selected$2", $html )
623625 : preg_replace( "|(<option[^>]*)(?=>$v</option>)|is", "$1 selected", $html );

Status & tagging log