# Add the results to the link cache
$lb->addResultToCache( LinkCache::singleton(), $res );
- # Set all the values to 'normal'. This can be done with array_fill_keys in PHP 5.2.0+
- $categories = array_combine(
- array_keys( $categories ),
- array_fill( 0, count( $categories ), 'normal' )
- );
+ # Set all the values to 'normal'.
+ $categories = array_fill_keys( array_keys( $categories ), 'normal' );
# Mark hidden categories
foreach ( $res as $row ) {
continue;
}
$wgContLang->findVariantLink( $category, $title, true );
- if ( $category != $origcategory ) {
- if ( array_key_exists( $category, $categories ) ) {
- continue;
- }
+ if ( $category != $origcategory && array_key_exists( $category, $categories ) ) {
+ continue;
}
$text = $wgContLang->convertHtml( $title->getText() );
$this->mCategories[] = $title->getText();
$this->addModuleStyles( $parserOutput->getModuleStyles() );
$this->addModuleMessages( $parserOutput->getModuleMessages() );
$this->addJsConfigVars( $parserOutput->getJsConfigVars() );
+ $this->mPreventClickjacking = $this->mPreventClickjacking
+ || $parserOutput->preventClickjacking();
// Template versioning...
foreach ( (array)$parserOutput->getTemplateIds() as $ns => $dbks ) {
$this->mPreventClickjacking = false;
}
+ /**
+ * Get the prevent-clickjacking flag
+ *
+ * @since 1.24
+ * @return boolean
+ */
+ public function getPreventClickjacking() {
+ return $this->mPreventClickjacking;
+ }
+
/**
* Get the X-Frame-Options header value (without the name part), or false
* if there isn't one. This is used by Skin to determine whether to enable
&& $only == ResourceLoaderModule::TYPE_SCRIPTS )
|| ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_STYLES )
&& $only == ResourceLoaderModule::TYPE_STYLES )
+ || ( $module->getOrigin() > $this->getAllowedModules( ResourceLoaderModule::TYPE_COMBINED )
+ && $only == ResourceLoaderModule::TYPE_COMBINED )
|| ( $this->mTarget && !in_array( $this->mTarget, $module->getTargets() ) )
) {
continue;
// Startup - this will immediately load jquery and mediawiki modules
$links = array();
- $links[] = $this->makeResourceLoaderLink( 'startup', ResourceLoaderModule::TYPE_SCRIPTS, /* $useESI = */ true );
+ $links[] = $this->makeResourceLoaderLink( 'startup', ResourceLoaderModule::TYPE_SCRIPTS, true );
// Load config before anything else
$links[] = Html::inlineScript(
/* $useESI = */ false, /* $extraQuery = */ array(), /* $loadCall = */ $inHead
);
- $modules = array();
- wfRunHooks( 'OutputPageScriptsForBottomQueue', array( $this, &$modules ) );
- if ( $modules ) {
- $links[] = $this->makeResourceLoaderLink( $modules, ResourceLoaderModule::TYPE_COMBINED,
- /* $useESI = */ false, /* $extraQuery = */ array(), /* $loadCall = */ $inHead
- );
- }
-
return self::getHtmlFromLoaderLinks( $links );
}