Ideally this would be an option in ErrorPageError (perhaps even the default),
but its constructor isn't very suitable for that.
After this lands, uses of ErrorPageError should be audited to see if it makes
sense to emit a 400 status code.
Change-Id: I4beb6a4f256446b98b66d5e4bcdbab8f247441a8
There's no reason for $ex->getMessage() to return nothing. Do like
ErrorPageError does and get the default English message for the parent.
Also move the appending of $titleText to $errorMessageParameters into
MalformedTitleException itself and document it, so every catcher of the
exception doesn't need to know about this, and fix the check so it
doesn't screw up for title "0".
Change-Id: I43d988602b847b67a3cf0aa84e271a0b5bd9adae
includes/Title.php
* The private method Title::secureAndSplit() now throws a
MalformedTitleException instead of returning false on invalid
titles.
* Added Title::newFromTextThrow(), which behaves exactly like
Title::newFromText() but throws MalformedTitleException instead of
returning null on invalid titles.
includes/title/MediaWikiTitleCodec.php
* Provide more information with the thrown MalformedTitleExceptions.
includes/MediaWiki.php
* Use the new Title::newFromTextThrow() to get detailed error
information, display it.
Change-Id: I4da8ecb457a77473e32d745ba48ab8505b35e45f
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef