Index: trunk/extensions/Arrays/Arrays.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | * @ingroup Arrays |
13 | 13 | * |
14 | 14 | * @licence MIT License |
| 15 | + * @version: 2.0 alpha |
15 | 16 | * |
16 | 17 | * @author Li Ding < lidingpku@gmail.com > |
17 | 18 | * @author Jie Bao |
— | — | @@ -288,8 +289,8 @@ |
289 | 290 | * in $subject before $subject is being parsed. So any template or argument influence in the patterns wouldn't make any |
290 | 291 | * sense in any sane scenario. |
291 | 292 | */ |
292 | | - $search = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@'; |
293 | | - $subject = isset( $args[3] ) ? trim( $frame->expand( $args[3], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : '@@@@'; |
| 293 | + $search = isset( $args[2] ) ? trim( $frame->expand( $args[2], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : null; |
| 294 | + $subject = isset( $args[3] ) ? trim( $frame->expand( $args[3], PPFrame::NO_ARGS | PPFrame::NO_TEMPLATES ) ) : null; |
294 | 295 | // options array: |
295 | 296 | $options = isset( $args[4] ) |
296 | 297 | ? self::parse_options( $frame->expand( $args[4] ) ) |
— | — | @@ -308,6 +309,13 @@ |
309 | 310 | return "undefined array: $arrayId"; |
310 | 311 | } |
311 | 312 | } |
| 313 | + |
| 314 | + // if there is no subject, there is no point in expanding. Faster! |
| 315 | + if( !$egArraysCompatibilityMode && $subject === null ) { |
| 316 | + // NO COMPATIBILITY-MODE |
| 317 | + // we can ignore options here, since if subject is null, options won't be set as well! |
| 318 | + return trim( implode( $delimiter, $array ) ); |
| 319 | + } |
312 | 320 | |
313 | 321 | $rendered_values = array(); |
314 | 322 | |