From a72332929c92dbf725886c2de3c36ba005ac2995 Mon Sep 17 00:00:00 2001 From: Platonides Date: Wed, 11 Aug 2010 17:11:24 +0000 Subject: [PATCH] getSkin() should get a Title as parameter. --- includes/parser/LinkHolderArray.php | 6 +++--- includes/parser/Parser.php | 18 +++++++++--------- includes/parser/ParserOptions.php | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index 5379d17ee3..aacbaff2aa 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -132,7 +132,7 @@ class LinkHolderArray { global $wgContLang; $colours = array(); - $sk = $this->parent->getOptions()->getSkin(); + $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle ); $linkCache = LinkCache::singleton(); $output = $this->parent->getOutput(); @@ -269,7 +269,7 @@ class LinkHolderArray { wfProfileIn( __METHOD__ ); # Make interwiki link HTML - $sk = $this->parent->getOptions()->getSkin(); + $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle ); $output = $this->parent->getOutput(); $replacePairs = array(); foreach( $this->interwikis as $key => $link ) { @@ -294,7 +294,7 @@ class LinkHolderArray { $variantMap = array(); // maps $pdbkey_Variant => $keys (of link holders) $output = $this->parent->getOutput(); $linkCache = LinkCache::singleton(); - $sk = $this->parent->getOptions()->getSkin(); + $sk = $this->parent->getOptions()->getSkin( $this->parent->mTitle ); $threshold = $this->getStubThreshold(); $titlesToBeConverted = ''; $titlesAttrs = array(); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 44bc614e22..8f507997cd 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -1145,7 +1145,7 @@ class Parser { substr( $m[0], 0, 20 ) . '"' ); } $url = wfMsg( $urlmsg, $id); - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); $la = $sk->getExternalLinkAttributes( "external $CssClass" ); return "{$keyword} {$id}"; } elseif ( isset( $m[5] ) && $m[5] !== '' ) { @@ -1174,7 +1174,7 @@ class Parser { global $wgContLang; wfProfileIn( __METHOD__ ); - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); $trail = ''; # The characters '<' and '>' (which were escaped by @@ -1423,7 +1423,7 @@ class Parser { global $wgContLang; wfProfileIn( __METHOD__ ); - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); $bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE ); $s = array_shift( $bits ); @@ -1572,7 +1572,7 @@ class Parser { * @private */ function maybeMakeExternalImage( $url ) { - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); $imagesfrom = $this->mOptions->getAllowExternalImagesFrom(); $imagesexception = !empty( $imagesfrom ); $text = false; @@ -1648,7 +1648,7 @@ class Parser { $e1_img = "/^([{$tc}]+)\\|(.*)\$/sD"; } - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); $holders = new LinkHolderArray( $this ); # split the entire text string on occurences of [[ @@ -1991,7 +1991,7 @@ class Parser { */ function makeKnownLinkHolder( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) { list( $inside, $trail ) = Linker::splitTrail( $trail ); - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); # FIXME: use link() instead of deprecated makeKnownLinkObj() $link = $sk->makeKnownLinkObj( $nt, $text, $query, $inside, $prefix ); return $this->armorLinks( $link ) . $trail; @@ -3743,7 +3743,7 @@ class Parser { } # We need this to perform operations on the HTML - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); # headline counter $headlineCount = 0; @@ -4480,7 +4480,7 @@ class Parser { $ig->setParser( $this ); $ig->setHideBadImages(); $ig->setAttributes( Sanitizer::validateTagAttributes( $params, 'table' ) ); - $ig->useSkin( $this->mOptions->getSkin() ); + $ig->useSkin( $this->mOptions->getSkin( $this->mTitle ) ); $ig->mRevisionId = $this->mRevisionId; if ( isset( $params['showfilename'] ) ) { @@ -4618,7 +4618,7 @@ class Parser { # * text-bottom $parts = StringUtils::explode( "|", $options ); - $sk = $this->mOptions->getSkin(); + $sk = $this->mOptions->getSkin( $this->mTitle ); # Give extensions a chance to select the file revision for us $skip = $time = $descQuery = false; diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index bdff54c26d..6f6e2dfadd 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -74,9 +74,9 @@ class ParserOptions { function getIsPrintable() { $this->accessedOptions['printable'] = true; return $this->mIsPrintable; } - function getSkin() { + function getSkin( $title = null ) { if ( !isset( $this->mSkin ) ) { - $this->mSkin = $this->mUser->getSkin(); + $this->mSkin = $this->mUser->getSkin( $title ); } return $this->mSkin; } -- 2.20.1