From: Jens Frank Date: Tue, 21 Sep 2004 17:57:33 +0000 (+0000) Subject: Instead of storing entire link attributes in wikitext for X-Git-Tag: 1.5.0alpha1~1911 X-Git-Url: http://git.cyclocoop.org/geomaker.php?a=commitdiff_plain;h=bedf5ae3c75e4503cff4411cb864949e2e8d235c;p=lhc%2Fweb%2Fwiklou.git Instead of storing entire link attributes in wikitext for deleayed link colouring, store pointer to an entry in array wgLinkHolders. Fixes BUG#493 and should be faster. Forgot to submit this this morning. Sorry!! --- diff --git a/includes/Skin.php b/includes/Skin.php index a4cb8f4e37..46a9c9563c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -53,6 +53,15 @@ unset($matches); require_once( 'RecentChange.php' ); +global $wgLinkHolders; +$wgLinkHolders = array( + 'namespaces' => array(), + 'dbkeys' => array(), + 'queries' => array(), + 'texts' => array(), + 'titles' => array() +); + /** * @todo document * @package MediaWiki @@ -1497,7 +1506,7 @@ class Skin { * Pass a title object, not a title string */ function makeLinkObj( &$nt, $text= '', $query = '', $trail = '', $prefix = '' ) { - global $wgOut, $wgUser; + global $wgOut, $wgUser, $wgLinkHolders; $fname = 'Skin::makeLinkObj'; # Fail gracefully @@ -1534,8 +1543,13 @@ class Skin { } # Allows wiki to bypass using linkcache, see OutputPage::parseLinkHolders() - $retVal = '{$trail}"; + $nr = array_push( $wgLinkHolders['namespaces'], $nt->getNamespace() ); + $wgLinkHolders['dbkeys'][] = $nt->getDBkey(); + $wgLinkHolders['queries'][] = $query; + $wgLinkHolders['texts'][] = $prefix.$text.$inside; + $wgLinkHolders['titles'][] = $nt; + + $retVal = '{$trail}"; } else { # Work out link colour immediately $aid = $nt->getArticleID() ;