From da24ff6b5ab3c41d14f7017f5edf1db8338e6cd8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 9 Apr 2008 12:43:48 +0000 Subject: [PATCH] Allow $len/$redir to be passed in from other points --- includes/LinkCache.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/LinkCache.php b/includes/LinkCache.php index 55aaae8805..4b3ba0d5a1 100644 --- a/includes/LinkCache.php +++ b/includes/LinkCache.php @@ -111,12 +111,14 @@ class LinkCache { /** * Add a title to the link cache, return the page_id or zero if non-existent * @param $title String: title to add + * @param $len int, page size + * @param $redir bool, is redirect? * @return integer */ - function addLink( $title ) { + function addLink( $title, $len = -1, $redir = NULL ) { $nt = Title::newFromDBkey( $title ); if( $nt ) { - return $this->addLinkObj( $nt ); + return $this->addLinkObj( $nt, $len, $redir ); } else { return 0; } @@ -125,9 +127,11 @@ class LinkCache { /** * Add a title to the link cache, return the page_id or zero if non-existent * @param $nt Title to add. + * @param $len int, page size + * @param $redir bool, is redirect? * @return integer */ - function addLinkObj( &$nt ) { + function addLinkObj( &$nt, $len = -1, $redirect = NULL ) { global $wgMemc, $wgLinkCacheMemcached, $wgAntiLockFlags; $title = $nt->getPrefixedDBkey(); if ( $this->isBadLink( $title ) ) { return 0; } @@ -151,8 +155,6 @@ class LinkCache { } # Some fields heavily used for linking... $id = NULL; - $len = -1; - $redirect = NULL; if( $wgLinkCacheMemcached ) { $id = $wgMemc->get( $key = $this->getKey( $title ) ); -- 2.20.1