From 53b7bdb63fc84bd832746a5c44c8b7e39baf16a3 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 25 Mar 2008 15:47:23 +0000 Subject: [PATCH] API: Added help text message that specifies whether a module is POST-only --- RELEASE-NOTES | 1 + includes/api/ApiBase.php | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d38a5a541d..7622dfe47a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -161,6 +161,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 13444) Add description to list=watchlist * (bug 13482) Disabled search types handled properly * Added inprop=talkid,subjectid to prop=info +* Added help text message that specifies whether a module is POST-only === Languages updated in 1.13 === diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index b92bd56adc..42950463b8 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -186,6 +186,9 @@ abstract class ApiBase { ); $msg = $lnPrfx . implode($lnPrfx, $msg) . "\n"; + if ($this->mustBePosted()) + $msg .= "\nThis module only accepts POST requests.\n"; + // Parameters $paramsMsg = $this->makeHelpMsgParameters(); if ($paramsMsg !== false) { @@ -640,7 +643,7 @@ abstract class ApiBase { * Internal code errors should be reported with this method */ protected static function dieDebug($method, $message) { - throw new MWException("Internal error in $method: $message"); + wfDebugDieBacktrace("Internal error in $method: $message"); } /** -- 2.20.1