/// Should be private. Used with addMeta() which adds <meta>
var $mMetatags = array();
- /// <meta keyworkds="stuff"> most of the time the first 10 links to an article
+ /// <meta keywords="stuff"> most of the time the first 10 links to an article
var $mKeywords = array();
var $mLinktags = array();
*/
private $mRedirectedFrom = null;
- /**
- * Name prefixes that can be used in addMeta
- */
- public static $metaAttrPrefixes = array(
- 'http' => 'http-equiv',
- 'itemprop' => 'itemprop',
- 'property' => 'property',
- );
-
/**
* Constructor for OutputPage. This should not be called directly.
* Instead a new RequestContext should be created and it will implicitly create
/**
* Add a new <meta> tag
* To add an http-equiv meta tag, precede the name with "http:"
- * To add a Microdata itemprop meta tag, precede the name with "itemprop:"
- * To add a RDFa property meta tag, precede the name with "property:"
- *
- * itemprop: and property: were introduced in 1.20, you can feature
- * test for them by checking for the key in the new
- * OutputPage::$metaAttrPrefixes variable.
*
* @param $name String tag name
* @param $val String tag value
* @return string html <script> and <style> tags
*/
protected function makeResourceLoaderLink( $modules, $only, $useESI = false, array $extraQuery = array(), $loadCall = false ) {
- global $wgResourceLoaderUseESI, $wgResourceLoaderInlinePrivateModules;
+ global $wgResourceLoaderUseESI;
if ( !count( $modules ) ) {
return '';
continue;
}
- // Support inlining of private modules if configured as such. Note that these
- // modules should be loaded from getHeadScripts() before the first loader call.
- // Otherwise other modules can't properly use them as dependencies (bug 30914)
- if ( $group === 'private' && $wgResourceLoaderInlinePrivateModules ) {
+ // Inline private modules. These can't be loaded through load.php for security
+ // reasons, see bug 34907. Note that these modules should be loaded from
+ // getHeadScripts() before the first loader call. Otherwise other modules can't
+ // properly use them as dependencies (bug 30914)
+ if ( $group === 'private' ) {
if ( $only == ResourceLoaderModule::TYPE_STYLES ) {
$links .= Html::inlineStyle(
$resourceLoader->makeModuleResponse( $context, $modules )
* @return array
*/
public function getJSVars() {
- global $wgUseAjax, $wgEnableMWSuggest;
+ global $wgUseAjax, $wgEnableMWSuggest, $wgContLang;
$latestRevID = 0;
$pageID = 0;
$ns = $title->getNamespace();
$nsname = MWNamespace::exists( $ns ) ? MWNamespace::getCanonicalName( $ns ) : $title->getNsText();
+ // Get the relevant title so that AJAX features can use the correct page name
+ // when making API requests from certain special pages (bug 34972).
+ $relevantTitle = $this->getSkin()->getRelevantTitle();
+
if ( $ns == NS_SPECIAL ) {
list( $canonicalName, /*...*/ ) = SpecialPageFactory::resolveAlias( $title->getDBkey() );
} elseif ( $this->canUseWikiPage() ) {
'wgPageContentLanguage' => $lang->getCode(),
'wgSeparatorTransformTable' => $compactSeparatorTransTable,
'wgDigitTransformTable' => $compactDigitTransTable,
+ 'wgRelevantPageName' => $relevantTitle->getPrefixedDBKey(),
);
- if ( $lang->hasVariants() ) {
- $vars['wgUserVariant'] = $lang->getPreferredVariant();
+ if ( $wgContLang->hasVariants() ) {
+ $vars['wgUserVariant'] = $wgContLang->getPreferredVariant();
}
foreach ( $title->getRestrictionTypes() as $type ) {
$vars['wgRestriction' . ucfirst( $type )] = $title->getRestrictions( $type );
}
foreach ( $this->mMetatags as $tag ) {
- $a = 'name'; // default attribute
- foreach ( self::$metaAttrPrefixes as $prefix => $attribute ) {
- // Check if the name starts with the prefix
- if ( strpos( $tag[0], "$prefix:" ) === 0 ) {
- // Set the attribute name we're using
- $a = $attribute;
- // Strip the prefix from the name
- $tag[0] = substr( $tag[0], strlen( $prefix ) + 1 );
- break;
- }
+ if ( 0 == strcasecmp( 'http:', substr( $tag[0], 0, 5 ) ) ) {
+ $a = 'http-equiv';
+ $tag[0] = substr( $tag[0], 5 );
+ } else {
+ $a = 'name';
}
$tags[] = Html::element( 'meta',
array(
* @param $args array
*/
public function addWikiMsgArray( $name, $args ) {
- $this->addWikiText( $this->msg( $name, $args )->plain() );
+ $this->addHTML( $this->msg( $name, $args )->parseAsBlock() );
}
/**