Return nothing on empty math tags instead of char encoding
[lhc/web/wiklou.git] / includes / Block.php
index 97b1f43..ff813ba 100644 (file)
@@ -113,9 +113,6 @@ class Block
                $options = array();
                $db =& $this->getDBOptions( $options );
 
-               $ret = false;
-               $killed = false;
-
                if ( 0 == $user && $address == '' ) {
                        # Invalid user specification, not blocked
                        $this->clear();
@@ -308,7 +305,7 @@ class Block
 
                $now = wfTimestampNow();
 
-               extract( $db->tableNames( 'ipblocks', 'user' ) );
+               list( $ipblocks, $user ) = $db->tableNamesN( 'ipblocks', 'user' );
 
                $sql = "SELECT $ipblocks.*,user_name FROM $ipblocks,$user " .
                        "WHERE user_id=ipb_by $cond ORDER BY ipb_timestamp DESC $options";
@@ -413,7 +410,7 @@ class Block
                        wfDebug("Doing retroactive autoblocks for " . $this->mAddress . "\n");
 
                        $row = $dbr->selectRow( 'recentchanges', array( 'rc_ip' ), array( 'rc_user_text' => $this->mAddress ),
-                               $fname, array( 'ORDER BY' => 'rc_timestamp DESC' ) );
+                               __METHOD__ , array( 'ORDER BY' => 'rc_timestamp DESC' ) );
 
                        if ( !$row || !$row->rc_ip ) {
                                #No results, don't autoblock anything
@@ -458,14 +455,16 @@ class Block
                        $wlEntry = substr($line, 1);
                        $wlEntry = trim($wlEntry);
 
-                       wfDebug("Checking $wlEntry\n");
+                       wfDebug("Checking $ip against $wlEntry...");
 
                        # Is the IP in this range?
                        if (IP::isInRange( $ip, $wlEntry )) {
-                               wfDebug("IP $ip matches $wlEntry, not autoblocking\n");
+                               wfDebug(" IP $ip matches $wlEntry, not autoblocking\n");
                                #$autoblockip = null; # Don't autoblock a whitelisted IP.
                                return; #This /SHOULD/ introduce a dummy block - but
                                        # I don't know a safe way to do so. -werdna
+                       } else {
+                               wfDebug( " No match\n" );
                        }
                }