From: Mr. E23 Date: Sat, 31 Jan 2004 01:53:01 +0000 (+0000) Subject: Fixed bug potentially causing problems if memcached fails for some reason (that is... X-Git-Tag: 1.3.0beta1~1061 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=59fc101580feadeaa5a28a611b0e568103d5c88e;p=lhc%2Fweb%2Fwiklou.git Fixed bug potentially causing problems if memcached fails for some reason (that is, returning FALSE) --- diff --git a/includes/User.php b/includes/User.php index a528e3aea4..5de7e88533 100644 --- a/includes/User.php +++ b/includes/User.php @@ -245,7 +245,7 @@ class User { global $wgDBname, $wgMemc; $key = "$wgDBname:newtalk:ip:{$this->mName}"; $newtalk = $wgMemc->get( $key ); - if( ! is_scalar( $newtalk ) ){ + if( ! is_integer( $newtalk ) ){ $sql = "SELECT 1 FROM user_newtalk WHERE user_ip='{$this->mName}'"; $res = wfQuery ($sql, DB_READ, "User::loadFromDatabase" ); diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index 6a0ef07af0..b66d249e17 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -25,7 +25,7 @@ class WatchedItem { global $wgMemc; $key = $this->watchKey(); $iswatched = $wgMemc->get( $key ); - if( is_scalar( $iswatched ) ) return $iswatched; + if( is_integer( $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 );