http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88738

Revision: 88738
Author:   happy-melon
Date:     2011-05-24 19:03:41 +0000 (Tue, 24 May 2011)
Log Message:
-----------
(bug 29116) follow-up r84475: normalise the empty string to null in 
Block::newFromTarget().

Modified Paths:
--------------
    trunk/phase3/includes/Block.php

Modified: trunk/phase3/includes/Block.php
===================================================================
--- trunk/phase3/includes/Block.php     2011-05-24 18:56:12 UTC (rev 88737)
+++ trunk/phase3/includes/Block.php     2011-05-24 19:03:41 UTC (rev 88738)
@@ -969,6 +969,12 @@
         *     not be the same as the target you gave if you used $vagueTarget!
         */
        public static function newFromTarget( $specificTarget, $vagueTarget = 
null, $fromMaster = false ) {
+               # (bug 29116) passing $vagueTarget = '' is not unreasonable 
here, but int(0)
+               # is a valid username, so we can't just use weak comparisons.
+               if( $vagueTarget === '' ){
+                       $vagueTarget = null;
+               }
+
                list( $target, $type ) = self::parseTarget( $specificTarget );
                if( $type == Block::TYPE_ID || $type == Block::TYPE_AUTO ){
                        return Block::newFromID( $target );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to