r13611 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r13610‎ | r13611 | r13612 >
Date:14:06, 12 April 2006
Author:tstarling
Status:old
Tags:
Comment:
Trim whitespace from #if return text, to mimic the behaviour of template parameters
Modified paths:
  • /trunk/extensions/ParserFunctions/ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions.php
@@ -27,17 +27,17 @@
2828
2929 function ifHook( &$parser, $test = '', $then = '', $else = '' ) {
3030 if ( trim( $test ) ) {
31 - return $then;
 31+ return trim( $then );
3232 } else {
33 - return $else;
 33+ return trim( $else );
3434 }
3535 }
3636
3737 function ifeq( &$parser, $left = '', $right = '', $then = '', $else = '' ) {
3838 if ( trim( $left ) == trim( $right ) ) {
39 - return $then;
 39+ return trim( $then );
4040 } else {
41 - return $else;
 41+ return trim( $else );
4242 }
4343 }
4444

Status & tagging log