API: Fix profiling errors caused by calling wfProfileClose() from dieUsage()
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index ff9129c..8afaae1 100644 (file)
@@ -265,7 +265,7 @@ abstract class ApiBase {
                                                $choices = array();
                                                $nothingPrompt = false;
                                                foreach ($type as $t)
-                                                       if ($t=='')
+                                                       if ($t === '')
                                                                $nothingPrompt = 'Can be empty, or ';
                                                        else
                                                                $choices[] =  $t;
@@ -635,6 +635,7 @@ abstract class ApiBase {
         * Call main module's error handler
         */
        public function dieUsage($description, $errorCode, $httpRespCode = 0) {
+               wfProfileClose();
                throw new UsageException($description, $this->encodeParamName($errorCode), $httpRespCode);
        }
 
@@ -698,6 +699,7 @@ abstract class ApiBase {
                'noemail' => array('code' => 'noemail', 'info' => "The user has not specified a valid e-mail address, or has chosen not to receive e-mail from other users"),
                'rcpatroldisabled' => array('code' => 'patroldisabled', 'info' => "Patrolling is disabled on this wiki"),
                'markedaspatrollederror-noautopatrol' => array('code' => 'noautopatrol', 'info' => "You don't have permission to patrol your own changes"),
+               'delete-toobig' => array('code' => 'bigdelete', 'info' => "You can't delete this page because it has more than \$1 revisions"),
 
                // API-specific messages
                'missingparam' => array('code' => 'no$1', 'info' => "The \$1 parameter must be set"),