new memcached client returns integers as strings
authorMr. E23 <e23@users.mediawiki.org>
Sat, 24 Jan 2004 22:52:06 +0000 (22:52 +0000)
committerMr. E23 <e23@users.mediawiki.org>
Sat, 24 Jan 2004 22:52:06 +0000 (22:52 +0000)
includes/User.php
includes/WatchedItem.php

index 8aa688d..b0f0db7 100644 (file)
@@ -230,7 +230,7 @@ class User {
                        global $wgDBname, $wgMemc;
                        $key = "$wgDBname:newtalk:ip:{$this->mName}";
                        $newtalk = $wgMemc->get( $key );
-                       if( ! is_integer($newtalk) ) {
+                       if( ! is_scalar( $newtalk ) ){
                                $sql = "SELECT 1 FROM user_newtalk WHERE user_ip='{$this->mName}'";
                                $res = wfQuery ($sql, DB_READ, "User::loadFromDatabase" );
 
index b66d249..6a0ef07 100644 (file)
@@ -25,7 +25,7 @@ class WatchedItem {
                global $wgMemc;
                $key = $this->watchKey();
                $iswatched = $wgMemc->get( $key );
-               if( is_integer( $iswatched ) ) return $iswatched;
+               if( is_scalar( $iswatched ) ) return $iswatched;
                
                $sql = "SELECT 1 FROM watchlist WHERE wl_user=$this->id AND wl_namespace=$this->ns AND wl_title='$this->eti'";
                $res = wfQuery( $sql, DB_READ );