From 59fc101580feadeaa5a28a611b0e568103d5c88e Mon Sep 17 00:00:00 2001 From: "Mr. E23" Date: Sat, 31 Jan 2004 01:53:01 +0000 Subject: [PATCH] Fixed bug potentially causing problems if memcached fails for some reason (that is, returning FALSE) --- includes/User.php | 2 +- includes/WatchedItem.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ); -- 2.20.1