From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/LinkCache.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'includes/LinkCache.php') diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 4f74cdd7..8d035763 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -33,7 +33,7 @@ class LinkCache { /** * General accessor to get/set whether SELECT FOR UPDATE should be used */ - public function forUpdate( $update = NULL ) { + public function forUpdate( $update = null ) { return wfSetVar( $this->mForUpdate, $update ); } @@ -57,7 +57,7 @@ class LinkCache { if ( array_key_exists( $dbkey, $this->mGoodLinkFields ) ) { return $this->mGoodLinkFields[$dbkey][$field]; } else { - return NULL; + return null; } } @@ -72,10 +72,12 @@ class LinkCache { * @param int $len * @param int $redir */ - public function addGoodLinkObj( $id, $title, $len = -1, $redir = NULL ) { + public function addGoodLinkObj( $id, $title, $len = -1, $redir = null ) { $dbkey = $title->getPrefixedDbKey(); - $this->mGoodLinks[$dbkey] = $id; - $this->mGoodLinkFields[$dbkey] = array( 'length' => $len, 'redirect' => $redir ); + $this->mGoodLinks[$dbkey] = intval( $id ); + $this->mGoodLinkFields[$dbkey] = array( + 'length' => intval( $len ), + 'redirect' => intval( $redir ) ); } public function addBadLinkObj( $title ) { @@ -112,7 +114,7 @@ class LinkCache { * @param $redir bool, is redirect? * @return integer */ - public function addLink( $title, $len = -1, $redir = NULL ) { + public function addLink( $title, $len = -1, $redir = null ) { $nt = Title::newFromDBkey( $title ); if( $nt ) { return $this->addLinkObj( $nt, $len, $redir ); @@ -128,7 +130,7 @@ class LinkCache { * @param $redir bool, is redirect? * @return integer */ - public function addLinkObj( &$nt, $len = -1, $redirect = NULL ) { + public function addLinkObj( &$nt, $len = -1, $redirect = null ) { global $wgAntiLockFlags, $wgProfiler; wfProfileIn( __METHOD__ ); @@ -167,9 +169,9 @@ class LinkCache { __METHOD__, $options ); # Set fields... if ( $s !== false ) { - $id = $s->page_id; - $len = $s->page_len; - $redirect = $s->page_is_redirect; + $id = intval( $s->page_id ); + $len = intval( $s->page_len ); + $redirect = intval( $s->page_is_redirect ); } else { $len = -1; $redirect = 0; -- cgit v1.2.2