X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FOutputPage.php;h=039342535f2ce515312828afd0e33b0b8ded5962;hb=923f94f691b7c7005988aeb5f74688cebf172a85;hp=968574754134e32462a3adc99c865aff1f00364e;hpb=ae089d79d1b16a0d006d7205ec90a3e7af08c4b6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 9685747541..039342535f 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1266,11 +1266,8 @@ class OutputPage extends ContextSource { # 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 ) { @@ -1641,6 +1638,8 @@ class OutputPage extends ContextSource { $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 ) { @@ -1968,6 +1967,16 @@ class OutputPage extends ContextSource { $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 @@ -2726,6 +2735,8 @@ $templates && $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; @@ -2896,7 +2907,7 @@ $templates // 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( @@ -3018,14 +3029,6 @@ $templates /* $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 ); }