summaryrefslogtreecommitdiff
path: root/includes/LinkCache.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/LinkCache.php')
-rw-r--r--includes/LinkCache.php22
1 files changed, 12 insertions, 10 deletions
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;