Commit graph

328 commits

Author SHA1 Message Date
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
Liangent
6eac0a40cf setSquidMaxage() globally if we can purge it, instead of in actions.
Change-Id: I404c994616eab0902a9e3650c97028e9bcfb22db
2012-06-04 14:46:36 +08:00
Brian Wolff
d5b26e049a Give a warning when people use $wgArticle. Add's a class that can be used to give warnings for other globals too.
See discussion on r111168.

Of course no one will see warning because trunk has $wgDeprecationReleaseLimit set to 1.17 by default
(<rant>have I mentioned how I don't like that variable. People enable warnings to be *warned* about
things. Making it so people won't get warned about things until a couple months after we've decided people
should stop using function/interface/etc defeats the purpose of having warnings</rant>)

p.s. Wasn't sure if this waranted something in the release notes, I don't think it does (It's just adding a warning)
but wasn't sure.
2012-02-13 00:19:06 +00:00
Alexandre Emsenhuber
d9abf3d8b9 Revert r111168 (removed of $wgArticle) since it seems that this is too early for some people; also removed the comment stating the removal was due in 1.20 (might want to be merged in 1.19). 2012-02-12 14:38:42 +00:00
Alexandre Emsenhuber
b31d540ba9 GOOD BYE $wgArticle!
It was stated that it would be removed in 1.20 and we are in 1.20.
2012-02-10 17:00:21 +00:00
Thomas Gries
87ed9b37f2 Please review carefully, I cannot see negative side effects from this patch. It gives extensions which use the (depreacted) UnknownAction hook a chance to see the original action= value. This fixes bug 34203 and bug 34161 UnknownAction hook problem: the hook must pass the unknown action to the callee and not the value "nosuchaction" 2012-02-05 11:00:07 +00:00
Alexandre Emsenhuber
afab06cc73 wfTime() -> microtime( true ), no need to use the former which is just a wrapper to the latter 2012-02-03 08:32:34 +00:00
Jeroen De Dauw
82a03f792a fix doc and var names 2012-01-29 15:24:06 +00:00
Platonides
f5c897bf66 Unused global 2012-01-26 17:16:41 +00:00
Antoine Musso
a15b11d3a5 bug 33646 Badtitle error page now emits a 400 HTTP status.
Sending a 200 OK status on bad title, prevents mobile browsers to
actually now the page is an error page.

Tested using:
 curl -I http://localhost/wiki/\]\]
 curl -I http://localhost/wiki/Special:BadTitle
2012-01-25 10:51:37 +00:00
Krinkle
db97a3a3f9 [Action] Fix action=ajax
* Move Ajax stuff to before regular title/page action handling. Ajax actions circumvent most stuff and return early from the regular execution.
* Needed because getAction / Action-classes can't handle action=ajax properly, which isn't until MediaWiki::performAction
* Also undo's debug 'true' in the if-statement from r109688
2012-01-21 20:13:57 +00:00
Krinkle
e10448fe06 [Wiki.php] Minor clean up
* Comment syntax consistency
* Re-use saved getTitle()
* Doing in separate commit for review ease
2012-01-21 20:10:35 +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
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
Krinkle
d03087df35 [Actions] Move the remaining actions out of MediaWiki::performAction into single action classes (finally).
- [Actions] -
* I am aware that eventually these classes should be more than just a few lines re-directing control to WikiPage, but I'm keeping these commits as uncontroversial as possible due to feature freeze. Refactor could be done later.
* Contributes to solution of bug 27930 - Ablity to get current action (The Right Way)
* Final goal: Get the current action without needing access to Wiki.php internals (i.e. with Action::factory in one hand and an instance of IContextSource in the other)
* Required for proper fix of r108342/108343 (currently marked FIXME)
2012-01-17 19:56:08 +00:00
Aaron Schulz
5a6559d8b1 Reverted r108743 per CR comment. This should at least be discussed first. 2012-01-12 19:41:18 +00:00
Sam Reed
a5c200a25b Kill "* @return void" 2012-01-12 19:12:24 +00:00
Sam Reed
b4a276e72e Documentation
Wrap some long lines
2012-01-12 19:03:32 +00:00
Niklas Laxström
7a8d6d8e71 Apparently we can commit code that doesn't compile but I am not allowed to have commit summary as "){} -> ) {}" 2012-01-11 19:47:21 +00:00
Sam Reed
bf4be6b5d4 Add @since to getPerformedAction, added in r108342
Caused site errors as not in 1.18 when trying to merge r108345 as a followup to r94131
2012-01-11 15:51:07 +00:00
Krinkle
6c474f0c07 Fix typo from r108342. 2012-01-08 02:49:33 +00:00
Krinkle
79948c3077 Implement MediaWiki::getPerformedAction()
* Fixes:
-- Bug 27930 - Ablity to get current action (The Right Way)
2012-01-08 01:31:56 +00:00
Alexandre Emsenhuber
418b3503b1 * Added WikiPage to RequestContext and related so that it can be shared to avoid creating a new object each time and thus avoiding database queries to load the state of the object
* Added Article::getPage() as accessor to the WikiPage object so that it can be set in the context from MediaWiki::initializeArticle()
* Use it WikiPage::main() to call doViewUpdates()

I'm doing to this now so that I can revert r105790 and use the WikiPage object before the 1.19 release
2012-01-06 20:00:04 +00:00
Alexandre Emsenhuber
9993fac519 Updated comment since $wgArticle is going to be removed in 1.20. 2012-01-02 11:59:56 +00:00
Alexandre Emsenhuber
9717e5cb18 * Inlinise the only usage of $user in MediaWiki::main()
* Change the name of the variable containing the WikiPage object for more consistency
2011-12-19 16:05:47 +00:00
Alexandre Emsenhuber
921bced830 Revert r106545 and pass a null variable by ref (also updated the documentation) so that the hook is called at the correct moment and after everything is executed.
This is *exactly* the same behaviour as before r88898 since $article was an out parameter to fill $wgArticle correctly.
2011-12-18 14:48:23 +00:00
Mark A. Hershberger
bbc2b0fdb1 followup r88898 -- move BeforeInitialize hook to where it can be
called in a way that matches the documented parameters

As it was, when an extension tried to use BeforeInitialize with the
documented parameters this resulted in an exception:

    Detected bug in an extension! Hook HookFunctionName has invalid
    call signature; Parameter 2 to HookFunctionName() expected to be a
    reference, value given
2011-12-18 01:46:25 +00:00
Mark A. Hershberger
420a172641 w/s 2011-12-18 01:32:11 +00:00
Chad Horohoe
5f723f8552 Get rid of a few more $wgTitles 2011-12-15 16:52:51 +00:00
Jeroen De Dauw
0b105ebf1d added missing deprecation notices 2011-12-13 19:51:03 +00:00
Sam Reed
7141742914 * (bug 32276) Skins were generating output using the internal page title which would allow anonymous users to determine wheter a page exists, potentially leaking private data. In fact, the curid and oldid request parameters would
allow page titles to be enumerated even when they are not guessable.
* (bug 32616) action=ajax requests were dispatched to the relevant internal functions without any read permission checks being done. This could lead to data leakage on private wikis.
2011-11-28 23:18:55 +00:00
Platonides
9b283db803 Follow-up r102521
Remove $wgUseExternalEditor globals.
2011-11-09 23:35:30 +00:00
Alexandre Emsenhuber
588539858c Some updates to EditPage and ExternalEdit:
* Made ExternalEdit use a context
* Updated DifferenceEngine to use ExternalEdit to send the diff stuff to reduce code duplication
* Introduced ExternalEdit::useExternalEngine() to check whether to use the external edit or diff (except for the action, section and oldid which are still checked in Wiki.php) to remove code duplication; external diff can now also be controlled with externaledit or internaledit URL parameters
* Use $wgContLang to get the name of the "Special" namespace instead of user's language
* Modified the line breaks in the comment on the top of the control file so that the URL is on its own line
* Updated extension to call EditPage::edit() instead of EditPage::submit(), the latter will just call the former
* Updated extension to let core handle itself the ExternalEdit mode instead of doing this themself
2011-11-09 15:31:55 +00:00
Alexandre Emsenhuber
381309f474 * Merged Title::userCanRead() check in Title::getUserPermissionsErrors()
* (bug 26020) Setting $wgEmailConfirmToEdit to true no longer removes diffs from recent changes feeds
* Added second parameter to Title::userCan() and Title::quickUserCan() to allow callers to pass the User object to use for checks; this changes Title::userCan()'s second parameter from "do expensive queries" flag to User, but all callers should have been updated in r102183
* Updated callers that might throw a PermissionsError to use getUserPermissionsErrors() instead and pass the error array to the exception
* Refactored duplicate code in missingPermissionError()
* Moved Title::isNamespaceProtected() a bit upper and Title::userCanRead() near Title::userCan() to have related functions in the same location
* Some minor refactoring in permission-related functions in Title
2011-11-06 19:59:46 +00:00
Alexandre Emsenhuber
3801a3cd28 * Made OuputPage::showPermissionsErrorPage() show a different messages for 'read', 'edit', 'create' and 'upload' actions to saying "You need to log in to do this action" when 1) The user is not logged in 2) The only error is a permissions error (no block or something else) and 3) The error can simply be avoided by logging in
* This replaces OuputPage::loginToUse() functionnality, made it simply throw a PermissionsEror exception and updated all calls in core
* Same for the check in SpecialUpload::execute(), EditPage::userNotLoggedInPage() and EditPage::noCreatePermission()
* Throw the same exception in EditPage::attemptSave() whether the user is logged in or not and let OuputPage::showPermissionsErrorPage() decide which message to display
* Replaced call to deprecated OutputPage::blockedPage() in SpecialUpload
* Displayed messages are the same as now, except the title is always "loginreqtitle"
* 'nocreatetitle' and 'uploadnologin' messages are still used by extensions, so I kept them, but the message 'whitelistedittitle' is not used anymore and has been removed
2011-11-05 19:51:05 +00:00
Aaron Schulz
6c4360c951 Make use of Title::isSpecialPage() in various places 2011-11-02 20:55:08 +00:00
Aaron Schulz
8363693b77 Alias NS_MEDIA page views to NS_FILE. Fixes bug 32032. 2011-11-02 18:47:04 +00:00
Aaron Schulz
d85333fda8 FU r100645: don't pass unused param 2011-10-24 22:19:02 +00:00
Alexandre Emsenhuber
f3ee658a8a * Remove $abort parameter from MediaWiki::checkMaxLag(); unused and it's a private function.
* Restore wfGetLB()->getMaxLag() call since we are no more in index.php
2011-10-24 20:37:54 +00:00
Alexandre Emsenhuber
9e230f3076 * Changed action=history to use an Action subclass
* Use local context instead of global variables
* Removed obsolete aliases PageHistory and PageHistoryPager; no longer used
* Made Action::getContext() and related methods public for the call in HistoryPager's constructor and also for consistency with other classes
2011-10-23 09:21:02 +00:00
Alexandre Emsenhuber
e1280017e0 * Changed action=raw to use an Action subclass
* Left RawPage with back compat code for extensions that use it
* Removed calls to Skin for gen=(css|js). Calling action=raw&gen=(css|js) will now unconditionally return empty content
* Removed Skin::generateUserJs() and Skin::generateUserStylesheet() since they were only used in RawPage
2011-10-20 08:10:25 +00:00
Alexandre Emsenhuber
e3dad1f942 Also catch Special:Badtitle to display the "Bad title" error message since this is now how it is passed in the context object. When such error occured, the user was redirected to Special:Badtitle and got the "Special page does not exist" message. 2011-10-03 14:04:43 +00:00
Aaron Schulz
9e04615a8e FR r98459: forgot to commit this! 2011-09-29 21:34:34 +00:00
Aaron Schulz
6014f0db91 HTMLFileCache refactoring:
* Rewrote class and split into three classes: a base class, and html cache and a more generic cache to be used later.
* The new classes now use RequestContext.
* Renamed fetchPageText() -> fetchText().
* Split out new saveText() function from saveToFileCache().
* Various other cleanups and fixes.
Also fixed backwards setting of $wgDisableCounters in rebuildFileCache.php.
2011-09-29 08:18:20 +00:00
Aaron Schulz
3cd27ff003 Improved filecache short-circuit slightly (catching NS_MEDIA and such) 2011-09-27 06:45:58 +00:00
Brion Vibber
7da1d55a84 Add in a 'TestCanonicalRedirect' hook to be called when about to make a redirect to the canonical page form of a regular page view. Some extensions such as MobileProfile may need to modify this logic to prevent incorrect redirects, such as on alternate en.m.wikipedia.org domain, where we'd want to either skip it or rewrite to the alternate domain.
Support for resolving bug 31012.
2011-09-19 23:14:52 +00:00
Alexandre Emsenhuber
ec9b551ca9 * Added HttpError exception as replacement for wfHttpError(); changed alls core calls to it except AjaxDispatcher.php
* Changed FeedUtils' call to it to be similar than feeds are completely disabled
* Use local context instead of global variables in Special:Userlogout
2011-09-16 18:50:13 +00:00
Daniel Friesen
391736c081 Use IContextSource instead of RequestContext inside type hints and instanceof checks. All we need is something that implements IContextSource and it's possible we may want to implement types of RequestContext that don't directly extend RequestContext but are perfectly valid to be passed to classes. 2011-09-15 15:19:49 +00:00