r40697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40696‎ | r40697 | r40698 >
Date:12:12, 10 September 2008
Author:ialex
Status:old
Tags:
Comment:
(bug 15543) fix for r38139: don't include $wgUser->mTouched and smaxage=0 in query strings of site CSS, but only to generated css (action=raw&gen=css).
Modified paths:
  • /trunk/phase3/includes/Skin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Skin.php
@@ -551,12 +551,6 @@
552552 'action' => 'raw',
553553 'maxage' => $wgSquidMaxage,
554554 );
555 - if( $wgUser->isLoggedIn() ) {
556 - // Ensure that logged-in users' generated CSS isn't clobbered
557 - // by anons' publicly cacheable generated CSS.
558 - $siteargs['smaxage'] = '0';
559 - $siteargs['ts'] = $wgUser->mTouched;
560 - }
561555
562556 // Add any extension CSS
563557 foreach( $out->getExtStyle() as $tag ) {
@@ -573,14 +567,20 @@
574568 'smaxage' => $wgSquidMaxage
575569 ) + $siteargs );
576570 # Site settings must override extension css! (bug 15025)
577 - $out->addStyle( self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI) );
578 - $out->addStyle( self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI), "print" );
 571+ $out->addStyle( self::makeNSUrl( 'Common.css', $query, NS_MEDIAWIKI ) );
 572+ $out->addStyle( self::makeNSUrl( 'Print.css', $query, NS_MEDIAWIKI ), 'print' );
579573 if( $wgHandheldStyle ) {
580 - $out->addStyle( self::makeNSUrl( 'Handheld.css', $query, NS_MEDIAWIKI), "handheld" );
 574+ $out->addStyle( self::makeNSUrl( 'Handheld.css', $query, NS_MEDIAWIKI ), 'handheld' );
581575 }
582576 $out->addStyle( self::makeNSUrl( $this->getSkinName() . '.css', $query, NS_MEDIAWIKI ) );
583577 }
584578
 579+ if( $wgUser->isLoggedIn() ) {
 580+ // Ensure that logged-in users' generated CSS isn't clobbered
 581+ // by anons' publicly cacheable generated CSS.
 582+ $siteargs['smaxage'] = '0';
 583+ $siteargs['ts'] = $wgUser->mTouched;
 584+ }
585585 // Per-user styles based on preferences
586586 $siteargs['gen'] = 'css';
587587 if( ( $us = $wgRequest->getVal( 'useskin', '' ) ) !== '' ) {
@@ -597,8 +597,8 @@
598598 // @FIXME: properly escape the cdata!
599599 $this->usercss = "/*<![CDATA[*/\n" . $previewCss . "/*]]>*/";
600600 } else {
601 - $out->addStyle( self::makeUrl($this->userpage .'/'.$this->getSkinName() .'.css',
602 - 'action=raw&ctype=text/css') );
 601+ $out->addStyle( self::makeUrl($this->userpage . '/' . $this->getSkinName() .'.css',
 602+ 'action=raw&ctype=text/css' ) );
603603 }
604604 }
605605

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38139Some tweaks for r38116:...ialex16:54, 28 July 2008