r92029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92028‎ | r92029 | r92030 >
Date:00:09, 13 July 2011
Author:nad
Status:deferred
Tags:
Comment:
but always return true if the compared value is empty
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -285,11 +285,11 @@
286286 $re = preg_match( "|^/|", $b );
287287 switch ( $operator ) {
288288 case '=':
289 - $cond = $re ? preg_match( $b, $a ) : ( $a == $b );
 289+ $cond = $re ? preg_match( $b, $a ) : ( empty( $b ) ? ( $a == $b ) : true );
290290 break;
291291
292292 case '!=':
293 - $cond = $re ? !preg_match( $b, $a ) : ( $a != $b );
 293+ $cond = $re ? !preg_match( $b, $a ) : ( empty( $b ) ? ( $a != $b ) : true );
294294 break;
295295
296296 default:

Status & tagging log