MediaWiki r29877 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r29876‎ | r29877 (on ViewVC)‎ | r29878 >
Date:01:06, 17 January 2008
Author:tstarling
Status:old
Tags:
Comment:
#ifexist: If the "else" parameter is missing, use the "test" parameter instead. This allows error-free text to be passed through with abbreviated syntax. Splarka's suggestion.
Modified paths:

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions.php
===================================================================
--- trunk/extensions/ParserFunctions/ParserFunctions.php	(revision 29876)
+++ trunk/extensions/ParserFunctions/ParserFunctions.php	(revision 29877)
@@ -108,9 +108,11 @@
 		}
 	}
 
-	function iferror( &$parser, $test = '', $then = '', $else = '' ) {
+	function iferror( &$parser, $test = '', $then = '', $else = false ) {
 		if ( preg_match( '/<(strong|span) class="error"/', $test ) ) {
 			return $then;
+		} elseif ( $else === false ) {
+			return $test;
 		} else {
 			return $else;
 		}

Status & tagging log

  • 15:23, 12 September 2011 Meno25 (Talk | contribs) changed the status of r29877 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox