From fa8078b6de1ee9b5e23cb37b3a33f99613dc4e94 Mon Sep 17 00:00:00 2001 From: Tom Gilder Date: Mon, 17 Jan 2005 21:21:30 +0000 Subject: [PATCH] Add timestamp to generated CSS URL, to make prefs show without force-reloading (bug 512) --- includes/SkinTemplate.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 23cb8a67f1..cfca563064 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -809,11 +809,11 @@ class SkinTemplate extends Skin { $fname = 'SkinTemplate::setupUserCss'; wfProfileIn( $fname ); - global $wgRequest, $wgTitle, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath; + global $wgRequest, $wgTitle, $wgAllowUserCss, $wgUseSiteCss, $wgContLang, $wgSquidMaxage, $wgStylePath, $wgUser; $sitecss = ''; $usercss = ''; - $siteargs = ''; + $siteargs = '&maxage=' . $wgSquidMaxage; # Add user-specific code if this is a user and we allow that kind of thing @@ -822,14 +822,15 @@ class SkinTemplate extends Skin { # if we're previewing the CSS page, use it if($wgTitle->isCssSubpage() and $action == 'submit' and $wgTitle->userCanEditCssJsSubpage()) { - $siteargs .= "&smaxage=0&maxage=0"; + $siteargs = "&smaxage=0&maxage=0"; $usercss = $wgRequest->getText('wpTextbox1'); } else { - $siteargs .= "&maxage=0"; $usercss = '@import "' . $this->makeUrl($this->userpage . '/'.$this->skinname.'.css', 'action=raw&ctype=text/css') . '";' ."\n"; } + + $siteargs .= '&ts=' . $wgUser->mTouched; } if ($wgContLang->isRTL()) $sitecss .= '@import "' . $wgStylePath . '/' . $this->stylename . '/rtl.css";' . "\n"; -- 2.20.1