From: Aaron Schulz Date: Wed, 9 Apr 2008 12:43:48 +0000 (+0000) Subject: Allow $len/$redir to be passed in from other points X-Git-Tag: 1.31.0-rc.0~48491 X-Git-Url: http://git.cyclocoop.org/%22.%24image2.%22?a=commitdiff_plain;h=da24ff6b5ab3c41d14f7017f5edf1db8338e6cd8;p=lhc%2Fweb%2Fwiklou.git Allow $len/$redir to be passed in from other points --- 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 ) );