Commit graph

82 commits

Author SHA1 Message Date
Yuri Astrakhan
9506e3d812 Spellchecked /includes directory
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls

Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"

Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
2013-03-13 03:42:41 -04:00
Tyler Anthony Romeo
4dcc7961df Fixed @param tags to conform with Doxygen format.
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.

Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
2013-03-11 13:15:01 -04:00
Reedy
9f4d498beb Few more message parameter type hints
Change-Id: I9017170a434b8924692e04410acc88831237ef8d
2013-03-06 21:10:59 +00:00
daniel
c0f47c445a Add getters to Message object.
Being able to get the message key and parameters from a Message object
is needed to be able to report errors from the API in an abstract,
language neutral way.

Change-Id: I8ee9da4005db7cb0a487457127f1e24fb11dbd66
2013-02-19 20:30:36 +01:00
umherirrender
1044b0b8df fix some spacing
Change-Id: I8f976013f33c5818e4402604fe8610aa3f43b0c6
2013-02-04 20:18:33 +00:00
Tyler Anthony Romeo
5f38cc2dbe Changed Message::content() to pass $this to MessageContent.
MessageContent can take either a Message or a message key in
the constructor. Since Message::content() is an instance method,
it makes sense to pass the instance itself rather than just
the key. This fixes cases where RawMessage::content() is called,
since passing RawMessage's key to MessageContent will not work
properly.

Change-Id: Ic3b935e5ac997df07eea40b438445ebd5024e306
2013-01-27 23:20:57 -05:00
umherirrender
6fbbbd17ca fix some spacing
Change-Id: Ie7bb35871cc99237f3a655f7db22ca1f0646df5e
2013-01-27 14:21:50 +01:00
daniel
185e4eee10 Catch excpt to avoid fatal in Message::__toString
PHP doesn't allow __toString to throw exceptions and will
trigger a fatal error if it does. So, catch any exceptions
and try to report them using wfWarn.

Change-Id: I52d38e9a927da4db18f4733fd207f9396adedf94
2013-01-08 17:55:31 +01:00
parent5446
69ea440003 Changed LoginForm::addNewaccountInternal() to return Status.
Rather than calling mainLoginForm() and returning false,
the addNewaccountInternal() function now returns a Status
on failure. mainLoginForm() is then called in addNewAccount()
and addNewAccountMailPassword() instead. This allows for
processing of the account creation form without submitting
anything to $wgOut.

Change-Id: I402c6bebcfe276233cc1f9e16efbe55a034b2181
2012-12-13 19:00:53 +00:00
Kevin Israel
7f9fe1b29d Remove the throw from Message::extractParam()
Per Tim Starling's comment on bug 41400, I replaced the throw (when a
message parameter is invalid) with a call to trigger_error().

The string [INVALID] is used as a placeholder to make it clear from
the output that an error has occurred.

Change-Id: I974d55d44d392c956e7de6d243da9d8dc07d8833
2012-11-29 22:33:57 +00:00
Aaron Schulz
e882babdbe Fixed MessageCache::parseText() and fixed docs for MessageCache::parse()
Change-Id: Ia297d9d0f893451a611051f9df7db3870b4c2333
2012-11-01 10:28:52 -07:00
Niklas Laxström
3f68a44535 More informative debugging messages
Change-Id: Ib83dde07e8935e9ae3d864a12af7f93b68ee8f85
2012-10-23 15:23:22 +00:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
daniel
329d5b3516 Merge branch 'Wikidata' into master.
This introduces the ContentHandler facility into MediaWiki,
see docs/contenthandler.txt.

For convenient review, a squashed version is available at
https://gerrit.wikimedia.org/r/27191

The ContentHandler facility is a major building block of the Wikidata project.
It has been discussed repeatedly on wikitech-l.

Change-Id: I3804e2d5f6f59e6a39db80744bdf61bfe8c14f98
2012-10-09 11:34:24 +02:00
Niklas Laxström
a719f7ef12 Add parameters to LanguageQqx-generated messages.
This avoids outputing bunch of unhelpful (parentheses) messages.

Change-Id: I55fab4f132f28be3fe7e4bc8f51d403b11d24284
2012-10-08 20:54:25 +00:00
daniel
c546fae8ed merge latest master into Wikidata branch
Change-Id: Id4e0f40c03679c13d8934a6add99b5cd86d0437d
2012-10-08 13:58:54 +02:00
Siebrand Mazeland
e9cae10e71 Fix typo in docs.
Change-Id: I9390711340f2426aaf46762f048738ac3a3de16a
2012-09-26 22:28:22 -07:00
daniel
9994968774 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 15:20:15 +02:00
Daniel Kinzler
392af46809 Revert "merged master"
This reverts commit 67bfdc7a68
2012-08-29 13:14:49 +00:00
daniel
67bfdc7a68 merged master
Change-Id: Ib2b879c4daa17401eeeb50767c0e5a54254855c3
2012-08-29 12:06:38 +02:00
jeroendedauw
50ac8ee5ed Added last missing @since tag to Message
Change-Id: I034ae0e5b1f19c1c28b1ecaecec69739434f699b
2012-08-27 23:46:06 +02:00
jeroendedauw
b26a67a76e Added missing @since tags to all methods
except for numParams, as Siebrand already did this in another commit

Change-Id: Ie3317af53c1df1eea99a77f402c6f7f1748dce1a
2012-08-27 22:22:19 +02:00
daniel
29719f846b merging latest master
Change-Id: I36b7f2f63ab8c08f8412d521dc68ea45c8b67711
2012-08-20 16:55:28 +02:00
jeroendedauw
5cf936775c Added @since tags
Change-Id: I90717790ac159713e48de7eb89649c3bcbce1d87
2012-08-09 21:03:46 +02:00
Waldir Pimenta
7800979a9f Introduce default expiry time for special:block (bug 32178)
Minor side change 1: fix preservation of infinite expiry time when reblocking:
the hardcoded value "indefinite" did not match with the default value
specified in ipboptions "infinite"

Minor side change 2: fix link in includes/Message.php's documentation

Change-Id: Icb1edabd8bb3dd1020c023b27b1270b9d2735b06
2012-07-31 18:12:01 +01:00
daniel
2eb4b6e2b3 use Message::content() to get message content 2012-06-12 17:31:01 +02:00
daniel
dee1ae55cc make Message content available as Content object 2012-06-11 14:10:12 +02:00
Alexandre Emsenhuber
a682b7335a Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I0db3461139284edcb6ac02923eb83d54e6756ffb
2012-05-12 22:33:51 +02:00
Santhosh Thottingal
8824515e57 Fix Bug 30681 - Wrong escaping for inexistent messages.
- If the message does not exist, do an early return from the toString method, instead of going through replaceParameter and format comparisons.
- Avoid getMessageText method.
- If the format is plain, do not escape the angle brackets.

Change-Id: I4561ee75d991ef8df3399ab17e5d75cb81f63f8f
2012-03-28 11:32:04 +05:30
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
Aaron Schulz
0f151738ea r80240: throw an exception if an empty message key array is given 2012-02-07 00:20:27 +00:00
Antoine Musso
1d594f6cc0 update Message class doc
Ping r110054
2012-01-26 14:55:38 +00:00
Chad Horohoe
048b9172f0 Fix r110054, \ -> @ 2012-01-26 13:45:50 +00:00
Antoine Musso
7bdbb72e88 enhance doxygen generation for Message class 2012-01-26 11:34:30 +00:00
Brian Wolff
64988333fd Update documentation on params method of Message class to indicate it can either be varags, or it can also
take an array of all the parameters as the first argument.
2011-12-22 00:51:43 +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
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
fb32210aee Whitespace/documentation 2011-09-14 15:07:20 +00:00
Platonides
c7137c50a4 Follow up r89585. Clean up after the test, expand inContentLanguage() comment. 2011-06-06 21:24:23 +00:00
Niklas Laxström
73776c92ee Fix for bug 29274 - Message class ignores $wgForceUIMsgAsContentMsg
Also added tests, which pass
2011-06-06 17:55:19 +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
Happy-melon
21813a563c Follow-up r86775: restub $wgLang. Not because it's a good idea, but because I can't see how to avoid the circular dependencies on it *without* stubbing it. Probably easier to just continue the drive to deprecate the global variable altogether. 2011-04-24 10:50:51 +00:00
Alexandre Emsenhuber
b454219e06 Don't double escape html entities for messages obtained through Message::escaped().
Since we require PHP 5.2.3+ and htmlspecialchars() has a fourth parameter to prevent double escaping since... PHP 5.2.3 (per manual), let's use it
2011-04-23 16:27:29 +00:00
Happy-melon
c80535ae10 Stop stubbing $wgLang and $wgContLang. There are no major code paths which do not call either $wgLang or $wgContLang at least once. All index.php calls unstub $wgContLang from MediaWiki::parseTitle() except in the edgecase of viewing pages referenced only by "curid=123", and since those will end up calling OutputPage::output() they will eventually be unstubbed at some point as well. All calls through load.php unstub $wgLang in ResourceLoaderContext::getLanguage() from ResouceLoader::respond() --> ResourceLoader::preloadModuleInfo(). All calls through api.php unstub $wgContLang in ApiResult::cleanUpUTF8() from ApiMain::printResult(). 2011-04-23 15:19:38 +00:00
Sam Reed
42b9b27823 Followup to r86312
<ialex> Reedy: that rev is breaking usage of {{PAGENAME}} in messages, such as in MediaWiki:Noarticles

Allowing optional passing in of a Title object (like it may be set in Message), but if it's not set, or not a title object, fall back and use $wgTitle (I'm sorry!)
2011-04-22 20:17:21 +00:00
Sam Reed
5622567290 Followup rr86304
We need a title object for parsing, do one against the message key

Doesn't seem to be the best way, but it's the most applicable. If I abused $wgTitle, Chad would come and beat me too ;)
2011-04-18 14:02:13 +00:00
Sam Reed
9c19cb6e38 Followup r86304
Things won't just happily accept a ParserOutput object when they were getting strings before

Add missing calling parameter
2011-04-18 13:53:24 +00:00
Sam Reed
3a0ed7a044 * (bug 28532) wfMsgExt() and wfMsgWikiHtml() use $wgOut->parse()
* (bug 16129) Transcluded special pages expose strip markers when they output parsed messages

Also adding some related documentation during my travels around the code
2011-04-18 12:43:53 +00:00
Alexandre Emsenhuber
ef1144e2e1 Per Hashar, fix for r83673: only accept StubContLang and StubUserLang for stub objects 2011-03-19 12:53:56 +00:00