X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRunJobs.php;h=761610e08fc2e01ebc12272573e9c7889313c6d8;hb=ee553f8e32a8f1bd8c0232dbbf1127e3592d29b2;hp=2312f76399f512cc5728b95492fa7bd3b2f7bced;hpb=d716155c8b2d6e4a51a4110195cee7a1794846e8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRunJobs.php b/includes/specials/SpecialRunJobs.php index 2312f76399..761610e08f 100644 --- a/includes/specials/SpecialRunJobs.php +++ b/includes/specials/SpecialRunJobs.php @@ -40,16 +40,11 @@ class SpecialRunJobs extends UnlistedSpecialPage { public function execute( $par = '' ) { $this->getOutput()->disable(); - if ( wfReadOnly() ) { - // HTTP 423 Locked - HttpStatus::header( 423 ); - print 'Wiki is in read-only mode'; - + wfHttpError( 423, 'Locked', 'Wiki is in read-only mode.' ); return; } elseif ( !$this->getRequest()->wasPosted() ) { - HttpStatus::header( 400 ); - print 'Request must be POSTed'; + wfHttpError( 400, 'Bad Request', 'Request must be POSTed.' ); return; } @@ -59,8 +54,9 @@ class SpecialRunJobs extends UnlistedSpecialPage { $params = array_intersect_key( $this->getRequest()->getValues(), $required + $optional ); $missing = array_diff_key( $required, $params ); if ( count( $missing ) ) { - HttpStatus::header( 400 ); - print 'Missing parameters: ' . implode( ', ', array_keys( $missing ) ); + wfHttpError( 400, 'Bad Request', + 'Missing parameters: ' . implode( ', ', array_keys( $missing ) ) + ); return; } @@ -72,8 +68,7 @@ class SpecialRunJobs extends UnlistedSpecialPage { $verified = is_string( $providedSignature ) && hash_equals( $correctSignature, $providedSignature ); if ( !$verified || $params['sigexpiry'] < time() ) { - HttpStatus::header( 400 ); - print 'Invalid or stale signature provided'; + wfHttpError( 400, 'Bad Request', 'Invalid or stale signature provided.' ); return; } @@ -94,8 +89,11 @@ class SpecialRunJobs extends UnlistedSpecialPage { if ( strpos( $errstr, 'Cannot modify header information' ) !== false ) { return true; // bug T115413 } - // Delegate unhandled errors to the default handlers - return false; + // Delegate unhandled errors to the default MediaWiki handler + // so that fatal errors get proper logging (T89169) + return call_user_func_array( + 'MWExceptionHandler::handleError', func_get_args() + ); } ); }