Commit graph

1052 commits

Author SHA1 Message Date
tstarling
b59613ccad Fix typo in comment
Change-Id: I5861982d91a32b5f65c250dde38fc5ce8f5c2693
2012-03-27 11:12:35 +11:00
tstarling
a09fccb77e Revert previous commit: accidental branch merge
This reverts commit 685fffec20, reversing
changes made to 59a68b48a7.

Change-Id: I5ed9f66e6afd5004ed5ee0f00e46888359376689
2012-03-27 10:57:13 +11:00
tstarling
685fffec20 Merge "Fix typo in comment" 2012-03-26 23:47:04 +00:00
tstarling
dbb43b3ea1 Fix typo in comment
Change-Id: Ia0af1e53c11c371f70dd60acdf5d32485bd8b3bc
2012-03-27 10:44:24 +11:00
Reedy
13169c88c1 * (bug 34212) ApiBlock/ApiUnblock allow action to take place without a token parameter present
* (bug 35317) CSRF in Special:Upload
Revert r56793, which removed the CSRF check for Special:Upload for normal file
uploads. Cross-site posting of file uploads without user interaction has been
possible since at least as early as Chrome 8 (late 2010) and Firefox 6 (mid
2011).

Commonist has used api.php since version 0.4.0 (April 2010), and the API
already requires an edit token, so Commonist 0.4.0+ is not affected by this
change.

* (bug 34907) Fix for CSRF vulnerability due to mw.user.tokens. Patch by Roan
Kattouw and Tim Starling.
* Filter out private modules early in ResourceLoader::makeResponse() and just
pretend they weren't specified. This means these modules cannot be loaded
through load.php . This filtering must not happen in makeModuleResponse(),
because that would break inlining.
* Force inlining of private modules in OutputPage::makeResourceLoaderLink(),
disregarding $wgResourceLoaderInlinePrivateModules
* Remove $wgResourceLoaderInlinePrivateModules
* Remove special treatment of private modules ($private) in
ResourceLoader::makeResponse() and sendResponseHeaders(), because we're not
allowing private modules to be loaded through here any more
* Remove identity checks in ResourceLoaderUserOptionsModule and
ResourceLoaderUserCSSPrefsModule, they didn't make a lot of sense before but
they're certainly useless now.
* Factored out error comment construction in ResourceLoader.php and stripped
comment terminations from exception messages. I didn't find an XSS
vulnerability but it looked scary.

Patchset2:
 Removes whitespace error that prevented automatic merge by Gerrit:
 includes/resourceloader/ResourceLoaderUserOptionsModule.php

Change-Id: I2dec8b8caf9db3c64919763865cc10cccdd6a1a3
2012-03-26 11:46:46 +02:00
Rob Moen
72c33b4523 User:PleaseStand patch fixes bug 34972 2012-03-13 17:57:54 +00:00
Alexandre Emsenhuber
71836d6643 * (bug 35014) Fix for r100529: including a special page no longer sets the page's title to the included page 2012-03-08 20:06:49 +00:00
Tim Starling
f6083ebd09 Partial revert of r97849: the wgUserVariant variable is useful and used even on special pages, removing it breaks b/c 2012-03-06 11:11:01 +00:00
Daniel Friesen
4bd652d90e Revert RDFa and Microdata improvements to addMeta in r111439 till after the git migration. 2012-02-20 22:48:43 +00:00
Roan Kattouw
77729220f3 Followup r110592: rename 'blocking' to 'async', and invert the logic everywhere. This makes blocking loading (async=false) the default as it was before. r110592 made async loading (blocking=false) the default, which caused backwards compatibility problems when page HTML generated by 1.18 interacted with the 1.19 version of mw.loader 2012-02-15 23:38:40 +00:00
Daniel Friesen
5b5bfc211b Introduce property: and itemprop: support for addMeta to add RDFa <meta property="..." content="..."> and Microdata <meta itemprop="..." content="..."> to the <head>.
This is done in a way that can also be feature tested, and technically could be expanded by extensions.
2012-02-14 02:22:02 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
0a626db6e1 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 19:29:36 +00:00
Sam Reed
85bbb0b080 Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 18:01:10 +00:00
Roan Kattouw
57310ab838 (bug 34289) user.options CSS loaded twice. Fixed by splitting off the CSS part of user.options into a separate module (user.cssprefs), as per the fixme comment added in r93363. No RELEASE-NOTEs because this is a regression fix that I'm gonna tag for backporting to 1.19 2012-02-09 11:04:24 +00:00
Roan Kattouw
595f852f8c Revert r111023 and r111024, they broke user.options . I'll fix this properly by splitting user.options's CSS part into a separate module; I've apparently known this was needed since r93363 2012-02-09 10:59:52 +00:00
Roan Kattouw
ec3c223b7b Explanatory comment for r111023 2012-02-09 10:42:53 +00:00
Roan Kattouw
253613a335 (bug 34289) user.options CSS loaded twice. Caused by r107534. Made embedded private modules scripts-only, because the styles for user.options are included separately in buildCssLinks(), because they need to be applied without JavaScript and because they need to respect $wgAllowUserCssPrefs. No RELEASE-NOTES because I want to merge this into 1.19 as a regression fix 2012-02-09 10:36:12 +00:00
Alexandre Emsenhuber
a172d738eb Recommit r110758 (again) now that the problem has been fixed in r110761 2012-02-06 17:34:33 +00:00
Antoine Musso
5912473690 reverts r110488
Breaks maintenance/rebuildFileCache.php with stack trace saying that
FauxRequest::getRequestURL() not implemented

Backtrace:
#0 includes/WebRequest.php(1261): FauxRequest->notImplemented('FauxRequest::ge...')
#1 includes/debug/Debug.php(266): FauxRequest->getRequestURL()
#2 includes/Skin.php(561): MWDebug::getDebugHTML(Object(RequestContext))
#3 includes/SkinTemplate.php(461): Skin->generateDebugHTML()
#4 includes/OutputPage.php(1982): SkinTemplate->outputPage()
#5 maintenance/rebuildFileCache.php(119): OutputPage->output()
#6 maintenance/doMaintenance.php(105): RebuildFileCache->execute()
#7 maintenance/rebuildFileCache.php(146): require_once('/srv/trunk/main...')
#8 {main}
2012-02-06 16:42:58 +00:00
Roan Kattouw
47f9cf8bd5 Followup r108184: per CR, blocking loads in debug mode were broken because debug mode uses chained loading, and the second part of the chain would run after the blocking flag had been set back to false. So get rid of the blocking flag as a global state flag, and instead pass it around all over the place so nestedAddScript() can use it. 2012-02-02 16:38:28 +00:00
Alexandre Emsenhuber
4d9259d36d Recommit r109062 (Only run some MWDebug code when really needed) but leaving the addition of ResourceLoader module inside the MWDebug class this time 2012-02-01 15:48:12 +00:00
Alexandre Emsenhuber
3dad5911eb Use the WikiPage object object instead of Title to get the page id and latest revision 2012-01-29 20:35:32 +00:00
Krinkle
3c72b527ed Add support for loading mediawiki.util from the top by default
* Introduces $wgPreloadJavaScriptMwUtil
* Instead of loading mediawiki.util as base module from the bottom, now loading it from queue position "top" if $wgPreloadJavaScriptMwUtil is true. And if false it'll remain in the bottom in practice as implied by other modules loading it as a dependency (i.e. mediawiki.page.ready depends on it)
* Fixes bug 33746
2012-01-29 19:40:11 +00:00
Benny Situ
978f299e03 Revert from 107187 to 107186 for bug24430 patch, it causes layout issue 2012-01-25 18:26:46 +00:00
Alexandre Emsenhuber
f5b75f1e98 Cleanup to statistics:
* Removed 'pcache_miss_invalid' from stats.php and clear_stats.php, no longer used
* Added missing 'job-insert' and 'job-pop' to clear_stats.php
* Added missing call to wfIncrStats( 'pcache_miss_absent' ) when there's no key in ParserCacge::get()
* Removed useless 'pcache_not_possible' stat from OutputPage::addWikiTextTitle() since that function is mostly used for interface messages
2012-01-23 16:27:13 +00:00
Krinkle
5f6fa16138 Reinstate r109223 per CR + fixes
* Action/Context stuff is pretty deeply nested everywhere.
* Should be okay now, at last.
* Reverts reverting r109243
* Same as r109223, except adding this:

+		if ( !$context->canUseWikiPage() ) {
+			return 'view';
+		}
2012-01-21 06:57:34 +00:00
Aaron Schulz
8d5837cc27 Reverted r109062 per code slush (also has a CR complaint) 2012-01-19 02:26:10 +00:00
Aaron Schulz
4831df5182 Reverted r109223 per CR 2012-01-17 23:07:15 +00:00
Krinkle
d28d00071a [Actions] Move action logic out of MediaWiki::getAction/MediaWiki::performAction into Action::getActionName.
* Follows-up r109195
* Reverts/Redoes r108342, r108343, r108345

* Contributes to solution of bug 27930 - Ability to get current action (The Right Way)
2012-01-17 21:49:27 +00:00
Alexandre Emsenhuber
7e16cba902 Only run some MWDebug code when really needed:
* Add the mediawiki.debug module from OutputPage::addDefaultModules() along with other modules
* Get the request information when building the JS output instead of in Setup.php
2012-01-16 21:29:05 +00:00
Alexandre Emsenhuber
626480bcd1 Fix for r108376: the whole string is already espcaed on output, no need to escape it twice 2012-01-13 13:30:58 +00:00
Krinkle
6ed9cdd2db Fix double-escaping in 108312 2012-01-09 00:15:38 +00:00
Krinkle
7d98f486d2 [Skin] Add CSS hook for action ("action-.." class on body)
* Fixes bug 4438
* Depends on r108342. See also r108343 which did a similar thing for mw.config wgAction

Previously attempted in r91871, which was reverted in r94131.

Added in OutputPage instead of Skin::getPageClasses, as this is not directly page nor skin related. It also ensures independency from skins, this CSS class should be always available so that it can be relied on by the front-end.
2012-01-08 01:49:06 +00:00
Krinkle
9c886da92e [mw.config] wgAction shouldn't use direct URL values
* Fixes bug 25800
* Depends on r108342
2012-01-08 01:34:59 +00:00
Niklas Laxström
412d71adf5 Don't expand templates in html <title>. This seems to have regressed some time ago. 2012-01-07 09:56:14 +00:00
Roan Kattouw
844e6f0d7f Fix up r108203: just loading mw.jqueryMsg in the bottom queue, then assuming its presence in mw.Message doesn't work, see CR comments.
* Moved message parsing (including $1 replacement) to Message.prototype.parser(), and let jqueryMsg override that when loaded
** Make the Message constructor public to make this possible
** Moved logic for skipping jqueryMsg when the message is simple from mw.Message to mw.jqueryMsg, where it belongs
* Remove mw.jqueryMsg from the default modules list in OutputPage. Modules that require PLURAL/GENDER should depend on mw.jqueryMsg
* TODOs
** The jqueryMsg parser is recreated for every mw.msg() call. It should probably be cached, but the only way I can think of is to add it as a member of the Map object, which is kind of weird
** Because jqueryMsg doesn't support a 'text' mode that expands PLURAL/GENDER but doesn't output HTML (leaves e.g. links alone), mw.Message.plain() and mw.Message.parse() currently behave identically. This is wrong and should be fixed, but that needs support in jqueryMsg too
2012-01-06 14:11:34 +00:00
Santhosh Thottingal
7a071abfb9 Use mw.jqueryMsg parser for message parsing to support PLURAL and GENDER
Follow up r107556 and based on the discussions on wikitech-l about this.
mediawiki.jqueryMsg is now loaded always. mw.msg uses the parser if required.
Add qunit test cases.
2012-01-06 09:14:45 +00:00
Roan Kattouw
7d5e3c0703 ResourceLoader: Add an experimental option to move the main module loading queue (the bottom queue) from the bottom of the <body> up into the <head> , while still being loaded asynchronously. This makes them load earlier, which should make the page load faster. This is the product of a long discussion on bug 27488
* Added a "blocking" state to mw.loader . When loading scripts while the document is not ready, the loader will use document.write() if blocking is true, and append to the <body> or the <head> if blocking is false. If the document is ready, the loader will always append to the <body>
* Enable blocking mode while loading the top queue, and disable it after. This ensures that modules in the top queue are still loaded in a blocking way as they were before
* If $wgResourceLoaderExperimentalAsyncLoading is true, the bottom queue is also loaded in the head, but with blocking mode disabled. Otherwise, it's loaded at the bottom of the <body> as before
* scripts-only and messages-only requests need special treatment:
** in the top queue, they can continue to use <script src="..."> tags because they are blocking
** if the bottom queue is at the bottom of the <body> (experimental async loading disabled), they can continue to use <script src="..."> tags as before
** if the bottom queue is in the <head> (experimental async loading enabled), they cannot use <script src="..."> tags, because those would block. Instead, call mw.loader.load() on the load.php URL
2012-01-05 23:32:41 +00:00
Roan Kattouw
6de6b5f6bf Redo r107066 properly: apply CSSJanus to user CSS previews when needed. Ping r94421 2012-01-04 20:01:29 +00:00
Roan Kattouw
b8a6966047 Revert r107066, see CR comments for full rationale. Basically this moves the previewed CSS to the wrong place in the <head> while not actually applying Janus 2012-01-04 17:15:25 +00:00
Alexandre Emsenhuber
22f0f724bb * Always set 'userjs' and 'userjsprev' items to false since they are now incorporated in 'bottomscript' (only affects skins not using OutputPage::headElement())
* Removed SkinTemplate::setupUserJs() since it's no longer used and marked OutputPage::isUserJsAllowed() for removal in 1.20 since its last call is now gone
2012-01-02 12:19:24 +00:00
Krinkle
be12ebf1ab [Core JS] More fixing of global config variable usage
* mw.config is the new way, and global config variable lookups are deprecated

* Based on two phase3-wide quick searches:
-- of " wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=321&hash=81700bf7486e4fee3b7bc1f83eb9eba6
-- of "!wg": http://toolserver.org/~krinkle/wikimedia-svn-search/view.php?id=327&hash=47c9d54a7a1d5d58a724dd834585f40d

Related changes:
* Changed some php comments mentioning "wg" variables to include the dollar sign, and a typo when the wf function prefix was meant.
* Removed TODO comment in wikibits.js and made it use the JS equivalent of wfUrlencode, which we have now, mw.util.wikiUrlencode 
* SpecialUpload.php: use OutputPage::addJsConfigVars instead of creating a new script tag through OutputPage::addScript(Skin::makeVariablesScript(..))
* Renamed wgUploadSetup in upload.js and made it local. Not used anywhere in ./trunk/phase3 and ./trunk/extensions
* Fix OutputPage::addJsConfigVars so that it can actually be called with an array instead of two arguments for key/value
* Some minor whitespace/convention stuff around the same line
2011-12-31 21:25:00 +00:00
Alexandre Emsenhuber
b89bffd783 * (bug 32702) Fix for r82273: readded Skin::makeGlobalVariablesScript() for backward compatibility and marked it as deprecated 2011-12-29 20:39:29 +00:00
Alexandre Emsenhuber
1b655a802a * Added Title::getLinksFrom() and Title::getTemplateLinksFrom() for consistency with Title::getLinksTo() and Title::getTemplateLinksTo()
* Deprecated WikiPage::getUsedTemplates() in favour of Title::getTemplateLinksFrom() and updated to it in core
2011-12-29 15:12:00 +00:00
Krinkle
10138296b4 Move embedded ResourceLoader modules to the <head>
* Embed "private" ResourceLoader modules in the <head> before the first loader link, instead of in the <body> after the last loader link
* Wow, was in the opposite place where it should've been :D
* Fixes bug 30914
2011-12-28 22:20:29 +00:00
Benny Situ
937563b444 bug24430 - patch from Chinchin, remove number of column for edit field in preference 2011-12-23 22:47:10 +00:00
Antoine Musso
fea110db5b apply CSS::Janus when user preview its CSS style
follow up r94421
2011-12-22 13:35:37 +00:00
Alexandre Emsenhuber
148549a687 Fix for r102116: link feed to Special:Recentchanges, not current page 2011-12-20 09:12:20 +00:00
Alexandre Emsenhuber
bd8d61b213 Pass the User object to Title::userCan() 2011-12-19 16:10:06 +00:00