Commit graph

1004 commits

Author SHA1 Message Date
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
Brion Vibber
f6a2974c7b Fix for r106144 -- wrong syntax 2011-12-14 00:50:06 +00:00
Brion Vibber
5a6372103a Add BeforePageRedirect hook to OutputPage, allowing extensions to override redirect output.
This is needed by MobileFrontend to normalize some redirects to the mobile site, such as on login.
2011-12-14 00:38:21 +00:00
Robin Pepermans
be2de16942 update all core usage of deprecated Title::userCanRead() 2011-12-13 11:05:30 +00:00
Daniel Friesen
42e8b0a8e7 Replace get{Local,Full,Link,Canonical}URL's $variant argument with a secondary $query argument and treat variant paths like we do action paths. 2011-12-12 19:19:23 +00:00
Daniel Friesen
c5337f8522 Introduce a Language::getHtmlLang method which returns the Bcp47 formatted language code and update code around core to output lang tags using this method instead of getCode so that we properly output things like lang="en-CA" instead of lang="en-ca" 2011-12-11 18:46:18 +00:00
Alexandre Emsenhuber
2629c3649f * Added revision's timestamp to OutputPage along with revision ID; avoid a DB hit in Skin::lastModified() when showing parser cache's content. This changed with the removal of $wgArticle in Skin since now it's a different WikiPage object and thus WikiPage::setTimetstamp() call is useless (but still kept).
* Added ParserOutput::(get|set)Timestamp() and the $mTimestamp member; avoid messing with isset()
2011-12-10 16:30:40 +00:00
Roan Kattouw
00bad0cf9b (bug 32230) Expose wgRedirectedFrom (title of the page we were redirected from, if any) in JavaScript. Patch by MrBlueSky 2011-11-30 12:43:10 +00:00
Sam Reed
39356de1a4 Moar documentations 2011-11-29 21:04:20 +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
Robin Pepermans
80a090ea72 * (bug 27721) Make JavaScript variables wgSeparatorTransformTable and wgDigitTransformTable depend on page content language so the sort script sorts correctly more often. It will e.g. sort according to the user language on special pages, where localised numbers are usually used.
* New JavaScript variable wgPageContentLanguage (independent from the bug, but I assume this var can be useful)
2011-11-28 20:53:26 +00:00
Chad Horohoe
7914b2ee68 (bug 29475) Remove "trackback" feature entirely from core. This has been disabled-by-default since its inception and nobody uses it.
If someone really really wants this, they can write an extension.

Language files need rebuilding, but I took care of En and messages.inc.
2011-11-23 17:14:03 +00:00
Roan Kattouw
88f5e7ae24 (bug 29569) Avoid fatal errors in OutputPage when nonexistent module names are passed in 2011-11-23 13:27:50 +00:00
John Du Hart
b520984ea2 Reverting r103856 since it does not work. <body> is not available at startup. 2011-11-22 15:58:28 +00:00
John Du Hart
480f0c7017 Followup r95318, move client-(no)js classes to the body tag per discussion in bug 30497 2011-11-21 22:53:24 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Alexandre Emsenhuber
02444c0390 Use WikiPage instead of Article to call getUsedTemplates() 2011-11-21 14:09:13 +00:00
Alexandre Emsenhuber
e2a0f92773 Fix for r102417: commiting OutputPage.php is actually a good idea 2011-11-08 18:02:26 +00:00
Alexandre Emsenhuber
2b552852e3 * Removed existence of Title object check since not having it would make other things crash in the same function
* Moved isArticleRelated() check one level up
* And pass the User object to Title::quickUserCan()
2011-11-07 13:51:40 +00:00
Alexandre Emsenhuber
e9a9e4999e * Only call Title::getPageLanguage() when necessary, i.e. after "!$wgDisableLangConversion && $wgCanonicalLanguageLinks" check passed
* Removed creation of Special:Recentchanges' Title object and use Title::isSpecial() instead
2011-11-05 20:25:00 +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
e11c958905 FU r96015: removed & in MakeGlobalVariablesScript hook 2011-11-03 22:21:19 +00:00
Alexandre Emsenhuber
f2d0453f9d * Made PermissionsError exception accept an optional second parameter for the description of the errors (as returned by Title::getUserPermissionsErrors())
* PermissionsError now calls OutputPage::showPermissionsErrorPage() to display the error (this is needed to make the item above work correctly)
* Removed the override of the HTML title in OutputPage::showPermissionsErrorPage() so that it shows "Permission errors - Sitename" instead of simply "Permission errors" for consistency with the other things
* Pass the error array returned by Title::getUserPermissionsErrors() to PermissionsError where available
* Converted direct calls to OutputPage::showPermissionsErrorPage() to throw an PermissionsError error instead
* Added 'action-rollback' message that will be displayed when accessing action=rollback without sufficient rights
* Changed getRestriction() in subclasses of Action to return null when they previously returned 'read' so that user rights can be check with Title::getUserPermissionsErrors()
* Reordered checks to do first user rights, then block (if needed) and finally read only (also if needed) so that users don't think the error is temporary when they both don't have right and the database is locked
2011-11-02 15:30:55 +00:00
Roan Kattouw
faeddd0da7 Prevent notice in OutputPage by casting to an array. This already exists on the WMF cluster as a live hack 2011-10-31 18:27:35 +00:00
Alexandre Emsenhuber
4b661607eb * Factorise the code used to prepare the OutputPage object to display an error page in OutputPage::prepareErrorPage()
* Changed default value of OutputPage::getPageTitle() to match the value of the 'internalerror' message
2011-10-28 15:45:54 +00:00
Alexandre Emsenhuber
b212bace90 Per Nikerabbit's comment on r100621:
* Removed OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() and make OutputPage::setPageTitle() and OutputPage::setHTMLTitle() accept a Message object
* Updated core calls (including some that I missed last time because of non-matching case)
* Added Message::setContext() and use it in RequestContext so that I don't need to duplicate the call in OutputPage
* Yes, I'm calling $this->msg() on places and then setting the context one more time in OutputPage::setPageTitle() or OutputPage::setHTMLTitle(), but at least I won't be confused about which objects $
2011-10-27 20:23:16 +00:00
Sam Reed
96641da58e Add, update, tweak documentation
Fix document comment blocks

Tweak some returns
2011-10-26 03:44:47 +00:00
Alexandre Emsenhuber
ae45908c59 Added OutputPage::setPageTitleMsg() and OutputPage::setHTMLTitleMsg() as modified versions of OutputPage::setPageTitle() and OutputPage::setHTMLTitle() that take an message name and its parameters; updated all calls in core that can use the two new functions 2011-10-24 17:24:38 +00:00
Antoine Musso
c1f23144e1 using real identity for hashar
Converting my pseudonym to use my real identity instead:
Ashar Voultoiz -> Antoine Musso
2011-10-24 09:08:13 +00:00
Alexandre Emsenhuber
500561e5d1 * Use local context to get messages
* Simply use getLang() instead of getContext()->getLang() now that this method exists
* Also changed addWikiMsgArray() to use a Message object with addWikiText() for the parse operation; removed its $options parameter, no caller was using it
2011-10-23 08:13:52 +00:00
Alexandre Emsenhuber
bd548f36e9 * Changed ParserOptions to store a Language object instead of only a string, avoids object -> string -> object conversion
* ParserOptions::getUserLang() will still return a string for compatibility, added ParserOptions::getUserLangObj() to get the object
* Added ParserOptions::newFromUserAndLang() and ParserOptions::newFromContext() to easily get a ParserOptions object when a context is available or when someone wants to force the language
* Updated OutputPage and Preferences to use newFromContext() and WikiPage to use newFromUserAndLang()
* ParserOptions::setUserLang() still accepts either a string or a Language object, but changed the calls to pass an object instead of a string
* Changed Parser::getFunctionLang() to return the Language object from ParserOptions when parsing interface messages rather than $wgLang directly and updated the documentation to say that $wgLang should not be used directly (as $wgUser, $wgTitle and $wgRequest)
2011-10-19 14:16:01 +00:00
Platonides
c59a53aa0b Remove unused global $wgLoadScript 2011-10-17 21:11:28 +00:00
Sam Reed
9ceb44a598 Fixup some assignments in conditionals
Add/normalise some more return statements
2011-10-16 03:27:12 +00:00
Jeroen De Dauw
31098cc759 added shortcut method for commonly used method combination 2011-10-10 21:05:02 +00:00
Roan Kattouw
76aaf47b64 Fix comment in r98374 2011-10-03 14:59:56 +00:00
Roan Kattouw
403f87be35 Rename $wgVaryOnXFPForAPI (introduced in r93818) to $wgVaryOnXFP and extend it to also apply to HTTP redirects. The previous name was overly specific for what has become a more generic setting, and we can still change it now that it's not in any release yet. 2011-10-03 13:15:28 +00:00
Sam Reed
1baa4e39d0 And an extra brace from r98467 2011-09-29 22:14:44 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Krinkle
59953d5809 New OutputPage::addJsConfigVars() method (bug 31233)
* to make the output page specific mw.config map extendable.
* fixes (bug 31233) Make OutputPage's mw.config array extendable internally instead of hard coded
* fixes weird unfinished comment from r61690
2011-09-28 22:08:08 +00:00
Robin Pepermans
07dc087494 Re-do r96798 ("LanguageConverter now depends on the page content language"), without the change in WikiPage which caused an infinite loop (see bug 31098) 2011-09-22 20:31:23 +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
Aaron Schulz
b741bcd227 FU r84610: Renamed getImageTimeKeys() to getFileSearchOptions() 2011-09-14 19:05:43 +00:00
Niklas Laxström
c48b41201a Revert r96798 - makes parser go infinite loop somewhere 2011-09-14 11:23:58 +00:00
Roan Kattouw
488d368b86 Followup r96978, clean up code duplication by factoring out the code building load.php requests into ResourceLoader::makeLoaderURL() and makeLoaderQuery() 2011-09-13 20:36:24 +00:00
Robin Pepermans
75932b439d * r96737: set OutputPage->addWikiText() as an interface message by default
* r96760: use 'noflip' for $flip in OutputPage->addInlineStyle() so it's always a string
* Add some parameter documentation
2011-09-11 21:07:17 +00:00
Robin Pepermans
9a6efcc3e4 (Bug 30364) LanguageConverter should depend on the page content language instead of the wiki content language. Remains largely the same, except for extensions using the PageContentLanguage hook like Translate and WikimediaIncubator.
* Made variant tabs hidden on special pages (has no or sometimes wrong/inconsistent effect there; plus it's mainly in the user language)
* Made redirects be in content language again (remove from Title->getPageLanguage())
2011-09-11 17:56:27 +00:00
Robin Pepermans
70ea9d6098 * Per Aaron on r96261, use string 'flip' instead of boolean
* Apparently @noflip should only be set once, otherwise it behaves differently
2011-09-10 23:51:08 +00:00
Robin Pepermans
e4e6a2ec64 Correctly parse interface messages as such, so it doesn't get converted according to the content language (like r96257/r94395/r94279)
Also whitespace fix in MessagesEn for r96723
2011-09-10 20:05:13 +00:00
Brian Wolff
40ca6f8308 $wgOverrideSiteFeed was double escaping urls (noticed in bug 30621).
(aka it was giving things with &amp;amp; in them :s )
2011-09-07 19:14:06 +00:00