Index: trunk/phase3/maintenance/language/messageTypes.inc |
— | — | @@ -502,3 +502,8 @@ |
503 | 503 | 'exif-gpsdirection-t', |
504 | 504 | 'exif-gpsdirection-m', |
505 | 505 | ); |
| 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 @@ |
16 | 16 | static $messageComments; |
17 | 17 | static $ignoredMessages; |
18 | 18 | static $optionalMessages; |
| 19 | + static $noEscapeMessages; |
19 | 20 | |
20 | 21 | /** |
21 | 22 | * Write a messages array as a PHP text and write it to the messages file. |
— | — | @@ -77,6 +78,7 @@ |
78 | 79 | require( dirname( __FILE__ ) . '/messageTypes.inc' ); |
79 | 80 | self::$ignoredMessages = $wgIgnoredMessages; |
80 | 81 | self::$optionalMessages = $wgOptionalMessages; |
| 82 | + self::$noEscapeMessages = $wgNoEscapeMessages; |
81 | 83 | |
82 | 84 | self::$loaded = true; |
83 | 85 | } |
— | — | @@ -210,7 +212,8 @@ |
211 | 213 | |
212 | 214 | # Check for the appropriate apostrophe and add the value |
213 | 215 | # Quote \ here, because it needs always escaping |
214 | | - $value = addcslashes( $value, '\\' ); |
| 216 | + if( !in_array( $key, self::$noEscapeMessages ) ) |
| 217 | + $value = addcslashes( $value, '\\' ); |
215 | 218 | |
216 | 219 | # For readability |
217 | 220 | $single = "'"; |