MediaWiki r41881 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r41880‎ | r41881 (on ViewVC)‎ | r41882 >
Date:11:45, 9 October 2008
Author:raymond
Status:old
Tags:
Comment:
* (bug 15730) #iferror catches more errors so any amount of other classes may precede or succede /error/.
Patch by René Kijewski
Modified paths:

Diff [purge]

Index: trunk/extensions/ParserFunctions/ParserFunctions.php
===================================================================
--- trunk/extensions/ParserFunctions/ParserFunctions.php	(revision 41880)
+++ trunk/extensions/ParserFunctions/ParserFunctions.php	(revision 41881)
@@ -133,7 +133,7 @@
 	}
 
 	function iferror( &$parser, $test = '', $then = '', $else = false ) {
-		if ( preg_match( '/<(strong|span|p|div)\s[^>]*?class="error"/', $test ) ) {
+		if ( preg_match( '/<(?:strong|span|p|div)\s(?:[^\s>]*\s+)*?class="(?:[^"\s>]*\s+)*?error(?:\s[^">]*)?"/', $test ) ) {
 			return $then;
 		} elseif ( $else === false ) {
 			return $test;

Status & tagging log

  • 09:02, 18 January 2012 Siebrand (Talk | contribs) changed the tags for r41881 [removed: parserfunctions]
  • 15:32, 12 September 2011 Meno25 (Talk | contribs) changed the status of r41881 [removed: ok added: old]
Personal tools
Namespaces
Variants
Views
Actions
Site
Support
Download
Development
Communication
Toolbox