From 728362918b402cb73dcd22fbae318d70e8c427e6 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Thu, 5 Jul 2007 19:46:14 +0000 Subject: [PATCH] Add comment on cacheability of getUserJs() to fend off other wayward devs --- includes/Skin.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index a85575cd74..ae3b10d8a1 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -412,12 +412,17 @@ class Skin extends Linker { } /** - * This returns MediaWiki:Common.js. For some bizarre reason, it does - * *not* return any custom user JS from user subpages. Huh? + * This returns MediaWiki:Common.js, and derived classes may add other JS. + * Despite its name, it does *not* return any custom user JS from user + * subpages. The returned script is sitewide and publicly cacheable and + * therefore must not include anything that varies according to user, + * interface language, etc. (although it may vary by skin). See + * makeGlobalVariablesScript for things that can vary per page view and are + * not cacheable. * - * @return string + * @return string Raw JavaScript to be returned */ - function getUserJs() { + public function getUserJs() { wfProfileIn( __METHOD__ ); global $wgStylePath; -- 2.20.1