Account creation messages don't need to be parsed. This is
a temporary fix to follow up when double-parsing was accidentally
added in 69ea440003 (I402c6bebcfe).
Bug: 44718
Bug: 52191
Change-Id: I333d5468820994625348316ebf6c57d4df025284
Similar to numParams(), added functions for other parameters
that can be formatted by the Language class. Adds functions for
expiry, size, timePeriod, duration, and bitrate parameters so
that the formatting doesn't have to be done at the caller.
Change-Id: I7b435fcc11824ead55e4c0f5512418187eae9a6f
Also removed some unnecessary ones. I think I've caught them all.
The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.
Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
Also fixes Message::getKey() to always return a string.
Rationale:
Some code, like RollbackAction, assumes that Status::getErrorArray will
return an array of the form ( messagekey, param... ), but this was not
the case when a Message object was passed to the Status.
This change makes sure Status::getErrorArray will always return arrays
of the expected form. This is especially important since the messages in
the Status object may be provided by extensions.
In order to convert Message objects to arrays of message keys and parameters,
Message::getKey() needed to be fixed to return a single key always.
Bug: 49338
Change-Id: I0deaa9888e9d86726a8e41ca606c571f56190c91
Added spaces after/before parenthesis
Removed unneeded parenthesis around some statements
Broke a long line
Change-Id: I7fbe129f7bbf524dd0598ece2a9708643f08453b
* 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
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
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
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
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
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
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
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
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
- 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
* 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 $