Commit graph

16 commits

Author SHA1 Message Date
Timo Tijhof
70429dc8a2 Use HttpStatus::header instead of manually crafting header()
Also:
* Update wfHttpError() to use uppercase DOCTYPE, to match other code
  such as Html.php, wfThumbError(), HttpError.php, etc.

Change-Id: I4027e7fe1a138b03f78797b6d1bfe7bd1064d360
2015-06-04 02:27:35 +00:00
Timo Tijhof
d01b5bc95c exception: Use standard message for HTTP status 500
This is the only case in the MediaWiki code base where a custom
message is used. Supporting in the standard HttpStatus library
would require a $customMessage parameter which seems unnecessary.

Additional information should be communicated using additional
HTTP response headers or inside the body content.

Besides, in current PHP versions and in Apache 2.4, the message is
already being ignored and replaced with the standard message (see T100984).

Bug: T100984
Change-Id: I11b58a2f3ce22568479d36027d15e5c6f428ff15
2015-06-03 02:49:44 +00:00
Kunal Mehta
90f3ca0439 Fix phpcs errors and warnings in includes/exception
Change-Id: I979c94a41df67426e621a734d5a86d55b890d269
2015-03-14 19:36:51 -07:00
Federico Leva
9f7d683fe5 Add i18n for the infamous "Fatal exception of type MWException" errorbox
These errors usually need to be reported, so it's better for the user
to understand them as much as possible.

Bug: T40095
Change-Id: Ibd2f984b66acb9150400126f21acf7cc5fc85acd
2015-02-23 21:33:24 +00:00
Timo Tijhof
399ba2fecf MWException: Log stack traces for php errors (not exceptions)
* Remove use of 'error' where it's redundant.
* Remove call to logException from responsibility of MWException.
  Call from exception handler instead.

Change-Id: I8764cf5df87b226813c9b9cf99f9b4f3fa4b7c92
2014-11-16 14:37:15 +01:00
Anomie
8f0ed5f5a7 Revert "Replace wfMsgReplaceArgs by RawMessage"
This was merged too quickly, has several issues.

This reverts commit 6abefb274f.

Change-Id: Ibf3e464fa9eb534d599274dd9262a30d5a6a6948
2014-09-29 17:41:56 +00:00
umherirrender
6abefb274f Replace wfMsgReplaceArgs by RawMessage
The replace of $n params can also be done using the Message class. In
case there are no message keys, the RawMessage class is used.

Deprecated wfMsgReplaceArgs, but added no warning, because it is used in
some extensions and from deprecated functions

Change-Id: I62091b09e4490e59ed7258566e0ddf2f8ee799d2
2014-09-29 19:23:19 +02:00
umherirrender
3b2b6a2773 Add missing @param to function docs
Change-Id: I47fa96a976f55a1a93cb75397285edb8c7f4cd8a
2014-08-14 20:22:52 +02:00
Chad Horohoe
fefc89448d MWException: Remove deprecated methods
No callers in core or extensions.

Change-Id: I3e2dc615bcd23838cf096625a767a7cf50fea140
2014-05-14 22:01:37 +00:00
Chad Horohoe
cfbeb437a3 MWException: Don't send headers multiple times
Ideally we wouldn't have sent headers yet, but in some weird
code paths where we output stuff raw (like Export) we might
have already sent them.

All depends on when the failure happened.

Should silence all of the "headers already sent" being seen
from exports.

Change-Id: I12e0532e93d30b2255f73a9d0e017c73e30c3e28
2014-05-13 14:40:39 -07:00
Siebrand Mazeland
f994817f6b Pass phpcs-strict on various files in includes/
These files have all had treatment before, and these occurrences have either
been missed or have been introduced after.

Change-Id: I06cdab4616b5bff47c85152df28f18c861730a23
2014-04-24 21:50:01 +02:00
umherirrender
9c614ac02d Fixed some @params documentation
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: I8c9f30128b46086064326708a4878228ba459447
2014-04-14 19:52:18 +00:00
Timo Tijhof
03d4947289 MWException: Fix sitename appearing twice in <title>
The MWException::getPageTitle method is wrapping the page title
in the 'pagetitle' ($1 - sitename) message, but OutputPage does
this as well when outputing <title>.

OutputPage::prepareErrorPage takes the first parameter as page
title (unwrapped, appears in <h1>,) and the second optional one
is for <title>, which (if omitted, like before) results in
pagetitle being applied by OutputPage.

Now that we specify them separately, this also removes the
sitename from the <h1> on the page, which always looked weird.

It also fixes DBQueryError (extends MWException) where previously
no sitename was added, it just returns 'databaseerror' from
its DBQueryError::getPageTitle() method.

Change-Id: I85d65d89e72b4497a050f440524ff6f959518b88
2014-03-31 11:49:54 -07:00
Brian Wolff
485ff9ead9 MWException: Expand {{SITENAME}} in pagetitle with Message::text()
Bug: 58447
Change-Id: I5f4fcb6d6e044f708cd6adb1bc7312d592fc74dd
2014-03-21 22:12:47 +00:00
addshore
7a56bf8168 Add scope to Exception class methods
Change-Id: I0097aa9a6d9c178c85706b90484f7a68d3ddbc8b
2014-02-24 21:21:09 +01:00
addshore
557af13086 Split Exception.php
Change-Id: I8273b342f8814887b65227457d0a461d7cd31e75
2014-02-24 21:17:59 +01:00