/**
* Fetch the set of available skins.
- * @return array of strings
+ * @return array associative array of strings
*/
static function getSkinNames() {
global $wgValidSkinNames;
}
return $wgValidSkinNames;
}
+
+ /**
+ * Fetch the skinname messages for available skins.
+ * @return array of strings
+ */
+ static function getSkinNameMessages() {
+ $messages = array();
+ foreach( self::getSkinNames() as $skinKey => $skinName ) {
+ $messages[] = "skinname-$skinKey";
+ }
+ return $messages;
+ }
/**
* Fetch the list of usable skins in regards to $wgSkipSkins.
$skinNames = Skin::getSkinNames();
- if ( $key == '' ) {
+ if ( $key == '' || $key == 'default' ) {
// Don't return the default immediately;
// in a misconfiguration we need to fall back.
$key = $wgDefaultSkin;
}
}
+ /**
+ * Make a <script> tag containing global variables
+ *
+ * @deprecated in 1.19
+ * @param $unused
+ * @return string HTML fragment
+ */
+ public static function makeGlobalVariablesScript( $unused ) {
+ global $wgOut;
+
+ wfDeprecated( __METHOD__, '1.19' );
+
+ return self::makeVariablesScript( $wgOut->getJSVars() );
+ }
+
/**
* Get the query to generate a dynamic stylesheet
*
protected function generateDebugHTML() {
global $wgShowDebug;
- $html = MWDebug::getDebugHTML();
+ $html = MWDebug::getDebugHTML( $this->getContext() );
if ( $wgShowDebug ) {
$listInternals = $this->formatDebugHTML( $this->getOutput()->mDebugtext );
if ( $forContent ) {
$msg = $msgObj->inContentLanguage()->text();
if ( $this->getLanguage()->getCode() !== $wgContLang->getCode() ) {
- $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $msg );
+ $msg = Html::rawElement( 'span', array( 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $msg );
}
return $msg;
} else {
$mp = $this->msg( 'mainpage' )->escaped();
$mptitle = Title::newMainPage();
- $url = ( is_object( $mptitle ) ? $mptitle->escapeLocalURL() : '' );
+ $url = ( is_object( $mptitle ) ? htmlspecialchars( $mptitle->getLocalURL() ) : '' );
$logourl = $this->getLogo();
$s = "<a href='{$url}'><img{$a} src='{$logourl}' alt='[{$mp}]' /></a>";
* @return array
*/
function buildSidebar() {
- global $parserMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
+ global $wgMemc, $wgEnableSidebarCache, $wgSidebarCacheExpiry;
wfProfileIn( __METHOD__ );
$key = wfMemcKey( 'sidebar', $this->getLanguage()->getCode() );
if ( $wgEnableSidebarCache ) {
- $cachedsidebar = $parserMemc->get( $key );
+ $cachedsidebar = $wgMemc->get( $key );
if ( $cachedsidebar ) {
wfProfileOut( __METHOD__ );
return $cachedsidebar;
wfRunHooks( 'SkinBuildSidebar', array( $this, &$bar ) );
if ( $wgEnableSidebarCache ) {
- $parserMemc->set( $key, $bar, $wgSidebarCacheExpiry );
+ $wgMemc->set( $key, $bar, $wgSidebarCacheExpiry );
}
wfProfileOut( __METHOD__ );
if ( strpos( $line, '|' ) !== false ) { // sanity check
$line = MessageCache::singleton()->transform( $line, false, null, $this->getTitle() );
$line = array_map( 'trim', explode( '|', $line, 2 ) );
+ if ( count( $line ) !== 2 ) {
+ // Second sanity check, could be hit by people doing
+ // funky stuff with parserfuncs... (bug 33321)
+ continue;
+ }
+
$extraAttribs = array();
$msgLink = $this->msg( $line[0] )->inContentLanguage();
} else {
$link = $line[0];
}
-
$msgText = $this->msg( $line[1] );
if ( $msgText->exists() ) {
$text = $msgText->text();
}
$notice = Html::rawElement( 'div', array( 'id' => 'localNotice',
- 'lang' => $wgContLang->getCode(), 'dir' => $wgContLang->getDir() ), $notice );
+ 'lang' => $wgContLang->getHtmlCode(), 'dir' => $wgContLang->getDir() ), $notice );
wfProfileOut( __METHOD__ );
return $notice;
}
if ( !is_null( $tooltip ) ) {
# Bug 25462: undo double-escaping.
$tooltip = Sanitizer::decodeCharReferences( $tooltip );
- $attribs['title'] = wfMsgExt( 'editsectionhint', array( 'language' => $lang, 'parsemag' ), $tooltip );
+ $attribs['title'] = wfMsgExt( 'editsectionhint', array( 'language' => $lang, 'parsemag', 'replaceafter' ), $tooltip );
}
$link = Linker::link( $nt, wfMsgExt( 'editsection', array( 'language' => $lang ) ),
$attribs,
# we can rid of it someday.
$attribs = '';
if ( $tooltip ) {
- $attribs = wfMsgExt( 'editsectionhint', array( 'language' => $lang, 'parsemag', 'escape' ), $tooltip );
+ $attribs = wfMsgExt( 'editsectionhint', array( 'language' => $lang, 'parsemag', 'escape', 'replaceafter' ), $tooltip );
$attribs = " title=\"$attribs\"";
}
$result = null;
*
* @param $fname String Name of called method
* @param $args Array Arguments to the method
+ * @return mixed
*/
function __call( $fname, $args ) {
$realFunction = array( 'Linker', $fname );