Commit graph

1066 commits

Author SHA1 Message Date
Aaron Schulz
73994ed596 Merge "Make OutputPage's mechanism for gathering Vary headers reusable" 2012-07-03 18:01:31 +00:00
Catrope
9867c1d1a2 Make OutputPage's mechanism for gathering Vary headers reusable
Maybe WebResponse would be a better place for this, but this'll work for
now.

* Add getVaryHeader() to get the serialized version of $mVaryHeader.
* Remove 'Cookie' from the initializer, and add it explicitly later
** This allows reuse by code that doesn't want 'Cookie' in there

Change-Id: Ifa8f74a21f832154b05e54ced95b9f9eb6052fcd
2012-07-03 09:32:13 -04:00
Timo Tijhof
50ed4912db Cleanup: Fix repeated array casting, fix variable name conflict
* No need to cast to array twice
* Should cast to array before doing count()
* Avoid variable name conflict in the for loop with the one outside
  the loop for clarity.

  No functional changes.

Change-Id: I93e7829e23372ea25e2f5123f7a990b6718663f3
2012-06-29 02:52:09 +02:00
Rob Moen
2e089a4e58 Move action.watch to a more suitable place and expose updateWatchLink
method in mw.page.watch.  Update method to toggle watch, unwatch
list item id attribute.
Patchset 2- Expose method with less code duplication, restore
comments, cleanup whitespace.
Patchset 3-5 Whitespace cleanup
Patchset 6 - Trigger a watch event on the updated li
Patchset 7 - Only trigger watch event if not updating
state, announce opposite of icon action, to properly
indicate action taken.
Patchset 8 - Cleanup spacing and comments issues,
change event namespace.
Patchset 9 - actually add the change
Change-Id: I591f9f847db391c5d1477dc2ed41de54ec266261
2012-06-20 12:56:50 -07:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Catrope
07c643f215 Fix bug in getXVO() that produced XVO headers with stray semicolons
addVaryHeader() converts $options to an array, so null values (no XVO
options) are converted to empty arrays. This led to headers like:

X-Vary-Options: Foo;string-contains=bar,Baz;,Quux;string-contains=xyz

This fix changes the "Baz;," part to "Baz,"

Change-Id: I2fa0b374f5d4cfa6b894cbd9de8c14354f04ad86
2012-06-01 05:50:30 -07:00
Alexandre Emsenhuber
aad9d5fd6b Removed checks for the "MEDIAWIKI" constant on files that only define classes.
This checks are not needed in that case.

Change-Id: Ia83447427de8b7ea32aced8ff43c7a252b8d504c
2012-05-23 21:20:42 +02:00
Tim Starling
92c7c6f426 Remove OutputPage::uncacheableBecauseRequestvars()
Fix for r10265: OutputPage::uncacheableBecauseRequestvars() as written
in that revision is backwards, apparently declaring all requests to be
uncacheable except those with useskin or uselang. Luckily getText() has
always converted its default parameter to a string, so the triple-equals
comparisons always fail, and uncacheableBecauseRequestvars() always
returns false.

In any case, it was never necessary to suppress the client-side cache
for useskin/uselang views, so the accidental behaviour was appropriate.

Change-Id: I520940867509b986a47d63ead9b549e8aa82fa1f
2012-05-23 09:37:53 +10:00
Alexandre Emsenhuber
d1f8640a3b Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ia45d0756cd84138da267bf1cbd1a58be7f28c6d1
2012-05-11 10:34:29 +02:00
lupo
ab6daccc77 Whitespace and typo fix
Change-Id: I060482b31959a78ecee4ad8851aebcac1f77e905
2012-04-26 22:53:11 +02:00
Brion VIBBER
7803b7cf98 Merge "(bug 32537) Pre-register default-loaded RL modules in the client-side loader." 2012-04-25 19:40:23 +00:00
lupo
9ab7ec0a9f (bug 32537) Pre-register default-loaded RL modules in the client-side
loader.

Site, user, and user.groups modules are pre-registered in JS client-side
loader. This prevents loading them again if they're given as explicit
dependencies of some other module.

Enabled modules are registered as "loading", disabled ones as "missing".
Empty modules register themselves as "ready".

Also adapt the client-side mw.loader.state to ensure that dependencies
are tracked if called with state "ready".

Note the FIXME in OutputPage.php; methinks this is an already existing
issue not fixed by this change.

Changeset 2: fix bug number in commit message (32537, not 32357!)

Changeset 3: change 'ready' registration as discussed; adapt line
lengths; clean up client-side code.

Changeset 4: "missing" status for disabled modules.

Change-Id: I595b3af1900d4bec0c35940ef51a19c8a7440faa
2012-04-25 20:24:03 +02:00
Max Semenik
30d98d655a Add function OutputPage::getHeadLinksArray()
...that returns head tags as associative array for the benefit of skin
makers who don't want to output every <meta> tag in the universe.

Patchset 2: make sure that array keys are unique

Change-Id: I6fa3c954d603e0e401cbdb68975d536cf07e11ab
2012-04-25 19:46:51 +04:00
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