Index: trunk/extensions/Arrays/RELEASE-NOTES |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | + Default separator for '#arrayprint' now is the languages default separator instead of ', '. |
18 | 18 | + '#arrayprint' will no longer expand the given wiki markup twice. Instead, it will escape special |
19 | 19 | characters of array values before they will be inserted into the markup. This way it won't be |
20 | | - possible anymore that array values can break the functions output. '$egArraysEscapeTemplates' |
| 20 | + possible anymore that array values can break the functions output. '$egArraysExpansionEscapeTemplates' |
21 | 21 | defines which special characters should be escaped by which template/parser function |
22 | 22 | + *** See 1.4 alpha for previous changes *** |
23 | 23 | - '#arraydefine' option 'print' no longer supports 'print=print' and parameters beyond options. |
Index: trunk/extensions/Arrays/Arrays.php |
— | — | @@ -278,7 +278,7 @@ |
279 | 279 | * {{#arrayprint:b|<br/>|@@@|[[name::@@@]]}} -- make SMW links |
280 | 280 | */ |
281 | 281 | static function pfObj_arrayprint( Parser &$parser, PPFrame $frame, $args ) { |
282 | | - global $egArrayExtensionCompatbilityMode; |
| 282 | + global $egArrayExtensionCompatbilityMode, $egArraysExpansionEscapeTemplates; |
283 | 283 | |
284 | 284 | // Get Parameters |
285 | 285 | $arrayId = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
— | — | @@ -351,7 +351,7 @@ |
352 | 352 | break; |
353 | 353 | } |
354 | 354 | |
355 | | - if( $egArrayExtensionCompatbilityMode ) { |
| 355 | + if( $egArrayExtensionCompatbilityMode || $egArraysExpansionEscapeTemplates === null ) { |
356 | 356 | // COMPATIBLITY-MODE: |
357 | 357 | /* |
358 | 358 | * don't leave the final parse to Parser::braceSubstitution() since there are some special cases where it |
— | — | @@ -1232,11 +1232,17 @@ |
1233 | 1233 | * @return string |
1234 | 1234 | */ |
1235 | 1235 | public static function escapeForExpansion( $string ) { |
1236 | | - global $egArraysEscapeTemplates; |
| 1236 | + global $egArraysExpansionEscapeTemplates; |
| 1237 | + |
| 1238 | + if( $egArraysExpansionEscapeTemplates === null ) { |
| 1239 | + return $string; |
| 1240 | + } |
| 1241 | + |
1237 | 1242 | $string = strtr( |
1238 | 1243 | $string, |
1239 | | - $egArraysEscapeTemplates |
| 1244 | + $egArraysExpansionEscapeTemplates |
1240 | 1245 | ); |
| 1246 | + |
1241 | 1247 | return $string; |
1242 | 1248 | } |
1243 | 1249 | |
Index: trunk/extensions/Arrays/Arrays_Settings.php |
— | — | @@ -28,20 +28,22 @@ |
29 | 29 | $egArrayExtensionCompatbilityMode = false; |
30 | 30 | |
31 | 31 | /** |
32 | | - * Contains a key-value par list of characters that should be replaced by a template or parser function |
| 32 | + * Contains a key-value pair list of characters that should be replaced by a template or parser function |
33 | 33 | * call within array values included into an #arrayprint. By replacing these special characters before |
34 | | - * including the values into the string which is being parsed afterwards, array values can't distract |
| 34 | + * including the values into the string which is being expanded afterwards, array values can't distract |
35 | 35 | * the surounding MW code. Otherwise the array values themselves would be parsed as well. |
36 | 36 | * |
37 | | - * This has no effect in case $egArrayExtensionCompatbilityMode is set to false! |
| 37 | + * This has no effect in case $egArrayExtensionCompatbilityMode is set to false! If set to null, Arrays |
| 38 | + * will jump to compatbility mode behavior on this, independently from $egArrayExtensionCompatbilityMode. |
38 | 39 | * |
39 | 40 | * @since 2.0 |
40 | 41 | * |
41 | | - * @var array |
| 42 | + * @var array|null |
42 | 43 | */ |
43 | | -$egArraysEscapeTemplates = array( |
| 44 | +$egArraysExpansionEscapeTemplates = array( |
44 | 45 | '=' => '{{=}}', |
45 | 46 | '|' => '{{!}}', |
46 | 47 | '{{' => '{{((}}', |
47 | 48 | '}}' => '{{))}}' |
48 | | -); |
\ No newline at end of file |
| 49 | +); |
| 50 | +$egArraysExpansionEscapeTemplates = null; |
\ No newline at end of file |