r32806 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r32805‎ | r32806 | r32807 >
Date:10:51, 5 April 2008
Author:ialex
Status:old
Tags:
Comment:
Fix for r32733: added a new array of settings that shouldn't be escaped
Modified paths:
  • /trunk/phase3/maintenance/language/messageTypes.inc (modified) (history)
  • /trunk/phase3/maintenance/language/writeMessagesArray.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messageTypes.inc
@@ -502,3 +502,8 @@
503503 'exif-gpsdirection-t',
504504 'exif-gpsdirection-m',
505505 );
 506+
 507+/** Messages that shouldn't be escaped with addcslashes (regexp, ...) */
 508+$wgNoEscapeMessages = array(
 509+ 'linkprefix',
 510+);
\ No newline at end of file
Index: trunk/phase3/maintenance/language/writeMessagesArray.inc
@@ -15,6 +15,7 @@
1616 static $messageComments;
1717 static $ignoredMessages;
1818 static $optionalMessages;
 19+ static $noEscapeMessages;
1920
2021 /**
2122 * Write a messages array as a PHP text and write it to the messages file.
@@ -77,6 +78,7 @@
7879 require( dirname( __FILE__ ) . '/messageTypes.inc' );
7980 self::$ignoredMessages = $wgIgnoredMessages;
8081 self::$optionalMessages = $wgOptionalMessages;
 82+ self::$noEscapeMessages = $wgNoEscapeMessages;
8183
8284 self::$loaded = true;
8385 }
@@ -210,7 +212,8 @@
211213
212214 # Check for the appropriate apostrophe and add the value
213215 # Quote \ here, because it needs always escaping
214 - $value = addcslashes( $value, '\\' );
 216+ if( !in_array( $key, self::$noEscapeMessages ) )
 217+ $value = addcslashes( $value, '\\' );
215218
216219 # For readability
217220 $single = "'";

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r32733Fix linkprefixsiebrand09:59, 3 April 2008

Status & tagging log