Commit graph

411 commits

Author SHA1 Message Date
Reedy
152eb2c862 setGroup doesn't return anything, so don't try and return its value
Fix docs on getGroup

Change-Id: Ia5f29013e01eee3b97dc755486175c21c5e24f4f
2012-04-07 17:36:24 +01:00
Alexandre Emsenhuber
345a593955 Follow-up r113223: set the "interface" flag in Message to true by default and set it to false when the page is included.
The point is to have the fix applied to all usages of IContextSource::msg() calls instead of only SpecialPage.
2012-03-13 18:41:13 +00:00
Niklas Laxström
455d6dae19 My proposed fix to bug 34987: gender not working in many special pages.
I haven't checked if there are other places whereh context is set to Message class, but if there are they might need a fix too.
2012-03-07 10:13:58 +00:00
Brian Wolff
adc2b6e101 (bug 28019) Make Special:MyPage and Special:MyTalk carry preloadtitle
url parameter to target page. Useful for inputbox extension.

Patch by Bagariavivek.

Perhaps should go through [[Manual:Parameters_to_index.php]] and add anything that's sane to the allowed list, at some point.
2012-03-04 05:15:50 +00:00
Sam Reed
c8eb4467f1 Fix user related direct member variable access 2012-02-16 00:54:34 +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
Sam Reed
68480e2ed3 Improve/add to documentation
Add braces

Explicitly define member variable
2011-12-24 23:11:25 +00:00
Niklas Laxström
e86fff1335 Stylize 2011-12-16 09:29:18 +00:00
Raimond Spekking
1be8a81633 Self revert r106080 which was a revert of r106070. 2011-12-14 11:49:09 +00:00
Raimond Spekking
629ba40146 Partly revert r106070 for now: Flooding of translatewiki.net log/channel:
PHP Notice: Use of SpecialPage::getPage was deprecated in MediaWiki 1.18. [Called from SFFormLinker::getFormEditLinkForPage in /www/w/extensions/SemanticForms/includes/SF_FormLinker.php at line 207] in /www/w/includes/GlobalFunctions.php on line 3520
2011-12-13 20:23:19 +00:00
Brion Vibber
493a76d453 Followup r106070, r86347: copy some doc comments that apply to multiple functions so doxygen will pick them up 2011-12-13 20:20:03 +00:00
Jeroen De Dauw
0b105ebf1d added missing deprecation notices 2011-12-13 19:51:03 +00:00
John Du Hart
f50eab171e Followup r103817, backing out ContextSource changes to SpecialPage and Action 2011-11-23 09:53:37 +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
6a3f3fb6e4 Moved read only check after permissions and block so that the user doesn't think the error is temporary in case he doesn't have the permission and the database is in read only mode 2011-11-15 18:26:05 +00:00
John Du Hart
5b88feca58 Adding function for checking if the database is in readonly mode
Replacing some code in SpecialPageForm to use these new functions
2011-11-15 01:19:04 +00:00
John Du Hart
2133770f23 Added function to SpecialPage to simplify permissions checking in SpecialPage classes. 2011-11-15 00:37:38 +00:00
Danny B
999324b674 * fixing Special:ListBots which behaved like Special:ListAdmins 2011-11-05 16:35:24 +00:00
Antoine Musso
67f632f255 bug 32086 Special:Permanentlink require a parameter
When Special:Permanentlink was not given any parameter it assumed oldid=0
and redirected to the Main_Page. This make it throw an error page instead.
2011-11-01 14:21:42 +00:00
Niklas Laxström
911df0bdfa Followup to r86053 - fix special page cases
[27-Oct-2011 05:51:24] PHP Notice:  Found alias defined for Listadmins when searching for special page aliases for ListAdmins. Case mismatch? [Called from SpecialPage::getLocalName in /www/sandwiki/includes/SpecialPage.php at line 464] in /www/sandwiki/includes/GlobalFunctions.php on line 3378
[27-Oct-2011 05:51:24] PHP Notice:  Found alias defined for Listadmins when searching for special page aliases for ListAdmins. Case mismatch? [Called from SpecialPage::getTitleFor in /www/sandwiki/includes/SpecialPage.php at line 261] in /www/sandwiki/includes/GlobalFunctions.php on line 3378
[27-Oct-2011 05:51:24] PHP Notice:  Found alias defined for Listusers when searching for special page aliases for ListUsers. Case mismatch? [Called from SpecialPage::getTitleFor in /www/sandwiki/includes/SpecialPage.php at line 261] in /www/sandwiki/includes/GlobalFunctions.php on line 3378
2011-10-27 05:57:14 +00:00
Aaron Schulz
44ff769519 Split out checkExecutePermissions() function from userCanExecute() in FormSpecialPage. The former handles actual execute() calls and throws exceptions, the later inherits its purpose from SpecialPage. It just checks the page restriction to see if a user generally *could* execute. This avoids the breakage that came up in r100723 where Special:SpecialPages was throwing permission errors due to the getUsablePages() call. 2011-10-26 06:22:25 +00:00
Alexandre Emsenhuber
308f7c6895 Added a User parameter to SpecialPageFactory::getUsablePages() so that it does not need to depend on $wgUser; updated the only call to it 2011-10-17 14:33:04 +00:00
Alexandre Emsenhuber
e057fb79b0 Use local context to get messages 2011-10-17 14:17:52 +00:00
Brion Vibber
f9af93f5af * (bug 31374) Pass relevant additional parameters for action=raw on Special:Mypage redirects
Found that Special:MyPage was sometimes being used in importScript() calls to make references to the owner's other user subpages, such as loading a User:Blah/monobook.js from User:Blah/vector.js.
The importScript() correctly included action=raw and ctype=text/javascript parameters, but Special:MyPage was redirecting to the actual URL and dropped the ctype parameter.

IE 9 actually now validates content-type for scripts loaded into <script> -- if and only if you send X-Content-Type-Options: nosniff. Since we now do that (since bug 15461 / r87997) this created a break for IE9 users when upgrading from MW 1.17 (without the nosniff) to MW 1.18 (with it).

Can also work around by replacing the Special:MyPage reference with a direct one.

No other browsers I tested (Firefox 8, Chrome 14, Opera 11.5) rejected a <script> load for text/x-wiki but it's a legit thing to do (Firefox does check for CSS)
2011-10-06 01:10:39 +00:00
Brion Vibber
8683c11bb0 * (bug 31289) Fix fatal error on special pages using $this->msg() on PHP 5.2
According to online PHP docs, func_get_args() doesn't work in function parameter lists until PHP 5.3.0.
It does, however, work as the *first* parameter, which happens here and there in older code (eg array_slice(func_get_args(),1)).
Assigning to a variable and passing through works fine for this case on PHP 5.2.17.
2011-10-01 02:03:05 +00:00
Alexandre Emsenhuber
1eb5110348 Follow-up r89568: use local context instead of $wgOut 2011-09-29 15:07: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
Alexandre Emsenhuber
d49f6e68bd Per Reedy, follow-up r93758: SpecialPage::capturePath() now has incorrect signature. Removed the function rather than updating it, since it's not called at all and current behavior is incompatible with the old one. 2011-08-16 11:05:19 +00:00
Sam Reed
9f785bc597 Followup r92430 per CR, like r94448 2011-08-15 18:56:37 +00:00
Niklas Laxström
d2fc621d5f Fu r93249: I see no reason to mark this private - protected should be the default value, only use private if you have some reason to. Avoids most of the breakage in out of tree extensions. 2011-07-28 06:13:13 +00:00
Roan Kattouw
f450e4eb8c Revert r93237 ("use User::getBlock() accessor rather than accessing $mBlock directly ..."): breaks a test (specifically TitlePermissionTest::testUserBlock()). From what I can tell it looks like the test case is expecting the text of the infinite-block message, but got a Message object instead 2011-07-27 22:28:59 +00:00
Antoine Musso
c608fa8714 makes SpecialPage::mName explicitly private
Only one occurence in Core : SpecialRandompage.
Extensions are done in a following commit.
2011-07-26 21:30:43 +00:00
Happy-melon
bd8da57b32 Follow-up r93234: use User::getBlock() accessor rather than accessing $mBlock directly. Also fixes r85951 CR, and remove code duplication in Title::checkUserBlock(). 2011-07-26 19:58:26 +00:00
Aaron Schulz
10d93c34cb Removed Special{$this->getName()}ModifyFormFields from r86482. Seems kind of weird, was undocumented, and is unused by extensions. 2011-07-22 21:31:50 +00:00
Sam Reed
ead9055a62 Update code comments that point to 1.18 to point to 1.19 2011-07-18 23:01:08 +00:00
Alexandre Emsenhuber
13d2bd6705 * Fixed comment
* Wrap arround RequestContext::msg() instead of doing that all that stuff once more
2011-07-07 20:17:55 +00:00
Sam Reed
d6906fed47 Add SpecialPermanentLink to Autoloader 2011-06-28 01:17:19 +00:00
Aaron Schulz
250e3fbd9f * Fixed 'Fatal error: Class 'SpecialMyuploads' not found in C:\wamp\www\MW_trunk\includes\SpecialPageFactory.php on line 318'
* Made use of $this->getUser() with special pages rather than wgUser
* Broke long lines
2011-06-27 20:36:59 +00:00
Happy-melon
5d00a3d11d Comment shuffling, also fixing r86347 CR. 2011-06-26 23:25:50 +00:00
Alexandre Emsenhuber
fa74cc15d4 And I forgot to commit this file in r89874 2011-06-11 08:40:35 +00:00
Alexandre Emsenhuber
e94c57e423 Recommit SpecialPage.php and SpecialPageFactory.php parts of r89406 (removal of magic __get() accessor for RequestContext) 2011-06-09 20:00:40 +00:00
Sam Reed
00806e7894 Refactoring to r89566
Refactor out duplicate code to SpecialPage
2011-06-06 15:07:23 +00:00
Brion Vibber
94c04f7cd1 Provisional revert of r89406, r89414: reference-related warnings need cleanup before applying code like this
Per CR http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89406#c17545 :
'Here is a third one: Strict Standards: Only variables should be passed by reference in /www/sandwiki/includes/Wiki.php on line 177 '

Offending bit is this:
-			SpecialPageFactory::executePath( $this->context->title, $this->context );
+			SpecialPageFactory::executePath( $this->getTitle(), $this->getContext() );

That function demands reference paramters for $title and $context, which is being violated here where we now pass function return values:

public static function executePath( Title &$title, RequestContext &$context, $including = false ) {

The $title does sometimes get replaced within the function body, but $context does not appear to ever be replaced (its *contents* are modified, which does not require passing by reference)
If replacing it is something it should be doing, then we need to be able to replace it upstream presumably, so $this->getTitle() probably isn't appropriate.
The $context probably should have the reference simply removed.
2011-06-03 18:48:59 +00:00
Happy-melon
295f513e8b More unpicking of r85288. I think this is all of the magic method calls, but they're very hard to grep for (part of the problem with them!), so let's leave the calls in with a wfDeprecated() for a while... 2011-06-03 11:04:49 +00:00
Happy-melon
6e7eb67b43 Start unpicking r85288 (magic __get() accessor for RequestContext). Instead, bring back some of r86872 (abstract base class for classes providing access to RequestContext methods), which is a more 'classical' solution. 2011-06-03 10:54:13 +00:00
Mark A. Hershberger
0a49fd69b0 Misc EOL w/s and spaces-instead-of-tabs fixes. One day I'll get around to nagging people for this stuff, but for now, I'll JFDI myself. 2011-05-25 15:39:47 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Siebrand Mazeland
e065a453f8 Make @deprecated documentation more consistent (see: http://svn.wikimedia.org/doc/deprecated.html). 2011-05-17 08:46:29 +00:00
Siebrand Mazeland
02e44a71b0 Revert r86872: Breaks LiquidThreads page moves with the below failure. Threads are lost and nowhere to be found any more.
[25-Apr-2011 18:12:45] /wiki/Special:MoveThread/Thread:User_talk:Siebrand/test/One_new_message: Exception: MWNamespace::getTalk does not make any sense for given namespace -1
#0 /www/w/includes/Namespace.php(81): MWNamespace::isMethodValidFor(-1, 'MWNamespace::ge...')
#1 /www/w/includes/WatchedItem.php(73): MWNamespace::getTalk(-1)
#2 /www/w/includes/User.php(2304): WatchedItem->addWatch()
#3 /www/w/includes/actions/WatchAction.php(53): User->addWatch(Object(Title))
#4 /www/w/includes/Action.php(376): WatchAction->onView()
#5 /www/w/extensions/LiquidThreads/classes/Thread.php(115): FormlessAction->execute()
#6 /www/w/extensions/LiquidThreads/classes/Thread.php(435): Thread::create(Object(Article), Object(Article), NULL, 1, 'One new message')
#7 /www/w/extensions/LiquidThreads/classes/Thread.php(414): Thread->leaveTrace('move test', Object(Title), Object(Title))
#8 /www/w/extensions/LiquidThreads/pages/SpecialMoveThread.php(107): Thread->moveToPage(Object(Title), 'move test', true)
#9 [internal function]: SpecialMoveThread->trySubmit(Array)
#10 /www/w/includes/HTMLForm.php(279): call_user_func(Array, Array)
#11 /www/w/includes/HTMLForm.php(228): HTMLForm->trySubmit()
#12 /www/w/includes/HTMLForm.php(242): HTMLForm->tryAuthorizedSubmit()
#13 /www/w/extensions/LiquidThreads/pages/ThreadActionPage.php(37): HTMLForm->show()
#14 /www/w/includes/SpecialPageFactory.php(459): ThreadActionPage->execute('Thread:User_tal...')
#15 /www/w/includes/Wiki.php(252): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#16 /www/w/includes/Wiki.php(98): MediaWiki->handleSpecialCases()
#17 /www/w/index.php(145): MediaWiki->performRequestForTitle(NULL)
#18 {main}
2011-04-25 18:20:53 +00:00
Happy-melon
70bdc008c4 Implement an interface and abstract class to hold the widely-reused get(Request|User|Title|Lang|Skin|Output) accessors for objects acting as a context source. Article is rather messier because both getTitle() and getUser() are in use for other things, and Article::$mTitle is in extremely wide use both within Article.php and outside. 2011-04-25 17:37:43 +00:00