r60223 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60222‎ | r60223 | r60224 >
Date:01:12, 19 December 2009
Author:nad
Status:deferred
Tags:
Comment:
white space problems with empty params
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin.php (modified) (history)
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -351,7 +351,7 @@
352352 foreach ( array_keys( $this->types ) as $k ) {
353353 $v = isset( $posted[$k] ) ? ( $this->types[$k] == 'bool' ? 'yes' : $posted[$k] ) : '';
354354 if ( !preg_match( "|\s*\|\s*$k\s*=|", $text ) ) $text .= "\n|$k=\n|"; # Treat non-existent fields as existing but empty
355 - $i = preg_match( "|^\s*\|\s*$k\s*=\s*(.*?)\s*(?=^\s*[\|\}])|sm", $text, $m );
 355+ $i = preg_match( "|^\s*\|\s*$k\s*= *(.*?) *(?=^\s*[\|\}])|sm", $text, $m );
356356 $r[$k] = isset( $m[1] ) ? $m[1] : '';
357357 if ( $v && !( $i && $this->cmpCallback( $r[$k], $v, $operator[$k] ) ) ) $match = false;
358358 }
@@ -760,7 +760,7 @@
761761 */
762762 function valuesFromText( $text ) {
763763 $values = array();
764 - preg_match_all( "|^\s*\|\s*(.+?)\s*=\s*(.*?)\s*(?=^\s*[\|\}])|sm", $text, $m );
 764+ preg_match_all( "|^\s*\|\s*(.+?)\s*= *(.*?) *(?=^\s*[\|\}])|sm", $text, $m );
765765 foreach ( $m[1] as $i => $k ) $values[$k] = $m[2][$i];
766766 return $values;
767767 }
Index: trunk/extensions/RecordAdmin/RecordAdmin.php
@@ -11,7 +11,7 @@
1212 * @licence GNU General Public Licence 2.0 or later
1313 */
1414
15 -define( 'RECORDADMIN_VERSION', '0.9.6, 2009-12-19' );
 15+define( 'RECORDADMIN_VERSION', '0.9.7, 2009-12-19' );
1616
1717 $wgRecordAdminUseNamespaces = false; # Whether record articles should be in a namespace of the same name as their type
1818 $wgRecordAdminCategory = 'Records'; # Category containing record types

Status & tagging log