Index: trunk/extensions/ParserFunctions/ParserFunctions_body.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | var $mTimeChars = 0; |
8 | 8 | var $mMaxTimeChars = 6000; # ~10 seconds |
9 | 9 | |
10 | | - function clearState(&$parser) { |
| 10 | + function clearState( $parser) { |
11 | 11 | $this->mTimeChars = 0; |
12 | 12 | $parser->pf_ifexist_breakdown = array(); |
13 | 13 | $parser->pf_markerRegex = null; |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | return $this->mExprParser; |
59 | 59 | } |
60 | 60 | |
61 | | - function expr( &$parser, $expr = '' ) { |
| 61 | + function expr( $parser, $expr = '' ) { |
62 | 62 | try { |
63 | 63 | return $this->getExprParser()->doExpression( $expr ); |
64 | 64 | } catch(ExprError $e) { |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | | - function ifexpr( &$parser, $expr = '', $then = '', $else = '' ) { |
| 69 | + function ifexpr( $parser, $expr = '', $then = '', $else = '' ) { |
70 | 70 | try{ |
71 | 71 | $ret = $this->getExprParser()->doExpression( $expr ); |
72 | 72 | if ( is_numeric( $ret ) ) { |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | return $result; |
94 | 94 | } |
95 | 95 | |
96 | | - function ifHook( &$parser, $test = '', $then = '', $else = '' ) { |
| 96 | + function ifHook( $parser, $test = '', $then = '', $else = '' ) { |
97 | 97 | if ( $test !== '' ) { |
98 | 98 | return $then; |
99 | 99 | } else { |
— | — | @@ -100,7 +100,7 @@ |
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | | - function ifObj( &$parser, $frame, $args ) { |
| 104 | + function ifObj( $parser, $frame, $args ) { |
105 | 105 | $test = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
106 | 106 | if ( $test !== '' ) { |
107 | 107 | return isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ''; |
— | — | @@ -109,7 +109,7 @@ |
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | | - function ifeq( &$parser, $left = '', $right = '', $then = '', $else = '' ) { |
| 113 | + function ifeq( $parser, $left = '', $right = '', $then = '', $else = '' ) { |
114 | 114 | if ( $left == $right ) { |
115 | 115 | return $then; |
116 | 116 | } else { |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | } |
119 | 119 | } |
120 | 120 | |
121 | | - function ifeqObj( &$parser, $frame, $args ) { |
| 121 | + function ifeqObj( $parser, $frame, $args ) { |
122 | 122 | $left = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
123 | 123 | $right = isset( $args[1] ) ? trim( $frame->expand( $args[1] ) ) : ''; |
124 | 124 | if ( $left == $right ) { |
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
131 | | - function iferror( &$parser, $test = '', $then = '', $else = false ) { |
| 131 | + function iferror( $parser, $test = '', $then = '', $else = false ) { |
132 | 132 | if ( preg_match( '/<(?:strong|span|p|div)\s(?:[^\s>]*\s+)*?class="(?:[^"\s>]*\s+)*?error(?:\s[^">]*)?"/', $test ) ) { |
133 | 133 | return $then; |
134 | 134 | } elseif ( $else === false ) { |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | | - function iferrorObj( &$parser, $frame, $args ) { |
| 141 | + function iferrorObj( $parser, $frame, $args ) { |
142 | 142 | $test = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
143 | 143 | $then = isset( $args[1] ) ? $args[1] : false; |
144 | 144 | $else = isset( $args[2] ) ? $args[2] : false; |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | } |
151 | 151 | } |
152 | 152 | |
153 | | - function switchHook( &$parser /*,...*/ ) { |
| 153 | + function switchHook( $parser /*,...*/ ) { |
154 | 154 | $args = func_get_args(); |
155 | 155 | array_shift( $args ); |
156 | 156 | $primary = trim(array_shift($args)); |
— | — | @@ -248,7 +248,7 @@ |
249 | 249 | * Following subpage link syntax instead of standard path syntax, an |
250 | 250 | * initial slash is treated as a relative path, and vice versa. |
251 | 251 | */ |
252 | | - public function rel2abs( &$parser , $to = '' , $from = '' ) { |
| 252 | + public function rel2abs( $parser , $to = '' , $from = '' ) { |
253 | 253 | |
254 | 254 | $from = trim($from); |
255 | 255 | if( $from == '' ) { |
— | — | @@ -317,11 +317,11 @@ |
318 | 318 | return $parser->mExpensiveFunctionCount <= $wgExpensiveParserFunctionLimit; |
319 | 319 | } |
320 | 320 | |
321 | | - function ifexist( &$parser, $title = '', $then = '', $else = '' ) { |
| 321 | + function ifexist( $parser, $title = '', $then = '', $else = '' ) { |
322 | 322 | return $this->ifexistCommon( $parser, false, $title, $then, $else ); |
323 | 323 | } |
324 | 324 | |
325 | | - function ifexistCommon( &$parser, $frame, $titletext = '', $then = '', $else = '' ) { |
| 325 | + function ifexistCommon( $parser, $frame, $titletext = '', $then = '', $else = '' ) { |
326 | 326 | global $wgContLang; |
327 | 327 | $title = Title::newFromText( $titletext ); |
328 | 328 | $wgContLang->findVariantLink( $titletext, $title, true ); |
— | — | @@ -374,7 +374,7 @@ |
375 | 375 | return $else; |
376 | 376 | } |
377 | 377 | |
378 | | - function ifexistObj( &$parser, $frame, $args ) { |
| 378 | + function ifexistObj( $parser, $frame, $args ) { |
379 | 379 | $title = isset( $args[0] ) ? trim( $frame->expand( $args[0] ) ) : ''; |
380 | 380 | $then = isset( $args[1] ) ? $args[1] : null; |
381 | 381 | $else = isset( $args[2] ) ? $args[2] : null; |
— | — | @@ -387,7 +387,7 @@ |
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | | - function time( &$parser, $format = '', $date = '', $local = false ) { |
| 391 | + function time( $parser, $format = '', $date = '', $local = false ) { |
392 | 392 | global $wgContLang, $wgLocaltimezone; |
393 | 393 | if ( isset( $this->mTimeCache[$format][$date][$local] ) ) { |
394 | 394 | return $this->mTimeCache[$format][$date][$local]; |
— | — | @@ -484,7 +484,7 @@ |
485 | 485 | return $result; |
486 | 486 | } |
487 | 487 | |
488 | | - function localTime( &$parser, $format = '', $date = '' ) { |
| 488 | + function localTime( $parser, $format = '', $date = '' ) { |
489 | 489 | return $this->time( $parser, $format, $date, true ); |
490 | 490 | } |
491 | 491 | |
— | — | @@ -544,7 +544,7 @@ |
545 | 545 | * |
546 | 546 | * Reports number of characters in string. |
547 | 547 | */ |
548 | | - function runLen ( &$parser, $inStr = '' ) { |
| 548 | + function runLen ( $parser, $inStr = '' ) { |
549 | 549 | wfProfileIn( __METHOD__ ); |
550 | 550 | |
551 | 551 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
— | — | @@ -562,7 +562,7 @@ |
563 | 563 | * Note: If the needle is an empty string, single space is used instead. |
564 | 564 | * Note: If the needle is not found, empty string is returned. |
565 | 565 | */ |
566 | | - function runPos ( &$parser, $inStr = '', $inNeedle = '', $inOffset = 0 ) { |
| 566 | + function runPos ( $parser, $inStr = '', $inNeedle = '', $inOffset = 0 ) { |
567 | 567 | wfProfileIn( __METHOD__ ); |
568 | 568 | |
569 | 569 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
— | — | @@ -591,7 +591,7 @@ |
592 | 592 | * Note: If the needle is an empty string, single space is used instead. |
593 | 593 | * Note: If the needle is not found, -1 is returned. |
594 | 594 | */ |
595 | | - function runRPos ( &$parser, $inStr = '', $inNeedle = '' ) { |
| 595 | + function runRPos ( $parser, $inStr = '', $inNeedle = '' ) { |
596 | 596 | wfProfileIn( __METHOD__ ); |
597 | 597 | |
598 | 598 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
— | — | @@ -624,7 +624,7 @@ |
625 | 625 | * Note: A negative value for "length" returns a string reduced in |
626 | 626 | * length by that amount. |
627 | 627 | */ |
628 | | - function runSub ( &$parser, $inStr = '', $inStart = 0, $inLength = 0 ) { |
| 628 | + function runSub ( $parser, $inStr = '', $inStart = 0, $inLength = 0 ) { |
629 | 629 | wfProfileIn( __METHOD__ ); |
630 | 630 | |
631 | 631 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
— | — | @@ -651,7 +651,7 @@ |
652 | 652 | * |
653 | 653 | * Note: If "substr" is empty, a single space is used. |
654 | 654 | */ |
655 | | - function runCount ( &$parser, $inStr = '', $inSubStr = '' ) { |
| 655 | + function runCount ( $parser, $inStr = '', $inSubStr = '' ) { |
656 | 656 | wfProfileIn( __METHOD__ ); |
657 | 657 | |
658 | 658 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
— | — | @@ -680,7 +680,7 @@ |
681 | 681 | * Note: Armored against replacements that would generate huge strings. |
682 | 682 | * Note: If "from" is an empty string, single space is used instead. |
683 | 683 | */ |
684 | | - function runReplace( &$parser, $inStr = '', |
| 684 | + function runReplace( $parser, $inStr = '', |
685 | 685 | $inReplaceFrom = '', $inReplaceTo = '', $inLimit = -1 ) { |
686 | 686 | global $wgPFStringLengthLimit; |
687 | 687 | wfProfileIn( __METHOD__ ); |
— | — | @@ -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 ) { |
743 | 743 | wfProfileIn( __METHOD__ ); |
744 | 744 | |
745 | 745 | $inStr = $this->killMarkers( $parser, (string)$inStr ); |
Index: trunk/extensions/ParserFunctions/ParserFunctions.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | class ParserFunctions_HookStub { |
66 | 66 | var $realObj; |
67 | 67 | |
68 | | - function registerParser( &$parser ) { |
| 68 | + function registerParser( $parser ) { |
69 | 69 | global $wgPFEnableStringFunctions; |
70 | 70 | |
71 | 71 | if ( defined( get_class( $parser ) . '::SFH_OBJECT_ARGS' ) ) { |
— | — | @@ -105,7 +105,7 @@ |
106 | 106 | } |
107 | 107 | |
108 | 108 | /** Defer ParserClearState */ |
109 | | - function clearState( &$parser ) { |
| 109 | + function clearState( $parser ) { |
110 | 110 | if ( !is_null( $this->realObj ) ) { |
111 | 111 | $this->realObj->clearState( $parser ); |
112 | 112 | } |