Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php |
— | — | @@ -729,7 +729,7 @@ |
730 | 730 | |
731 | 731 | |
732 | 732 | /** |
733 | | - * {{#explode:string | delimiter | position}} |
| 733 | + * {{#explode:string | delimiter | position | limit}} |
734 | 734 | * |
735 | 735 | * Breaks "string" into chunks separated by "delimiter" and returns the |
736 | 736 | * chunk identified by "position". |
— | — | @@ -738,7 +738,7 @@ |
739 | 739 | * Note: If the divider is an empty string, single space is used instead. |
740 | 740 | * Note: Empty string is returned if there are not enough exploded chunks. |
741 | 741 | */ |
742 | | - function runExplode ( $parser, $inStr = '', $inDiv = '', $inPos = 0 ) { |
| 742 | + function runExplode ( $parser, $inStr = '', $inDiv = '', $inPos = 0, $inLim = null ) { |
743 | 743 | wfProfileIn( __METHOD__ ); |
744 | 744 | |
745 | 745 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
— | — | @@ -754,7 +754,7 @@ |
755 | 755 | |
756 | 756 | $inDiv = preg_quote( $inDiv, '/' ); |
757 | 757 | |
758 | | - $matches = preg_split( '/'.$inDiv.'/u', $inStr ); |
| 758 | + $matches = preg_split( '/'.$inDiv.'/u', $inStr, $inLim ); |
759 | 759 | |
760 | 760 | if( $inPos >= 0 && isset( $matches[$inPos] ) ) { |
761 | 761 | $result = $matches[$inPos]; |