From 029d76d20992144ce435f05d364b8f0f6500a4cc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 19 Feb 2004 06:40:52 +0000 Subject: [PATCH] Make sure that id taken from cookie is an int; otherwise it goes to 0 --- includes/User.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/User.php b/includes/User.php index b3e5d98fb4..7a21052abf 100644 --- a/includes/User.php +++ b/includes/User.php @@ -163,7 +163,7 @@ class User { return new User(); } } else if ( isset( $HTTP_COOKIE_VARS["{$wgDBname}UserID"] ) ) { - $sId = $HTTP_COOKIE_VARS["{$wgDBname}UserID"]; + $sId = IntVal( $HTTP_COOKIE_VARS["{$wgDBname}UserID"] ); $wsUserID = $sId; } else { return new User(); @@ -214,6 +214,10 @@ class User { function loadFromDatabase() { if ( $this->mDataLoaded ) { return; } + + # Paranoia + $this->mId = IntVal( $this->mId ); + # check in separate table if there are changes to the talk page $this->mNewtalk=0; # reset talk page status if($this->mId) { -- 2.20.1