X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialRunJobs.php;h=cb1e892e2f4c76689363d8640e174e0715a4ec69;hb=d6551bcbad8e2c0c94af630212433150ac7ff841;hp=e1e2049d1615cbe58de062d72a46455f6528ed5c;hpb=a303296f2730d6279a249bde77f3e0b9b42e494f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialRunJobs.php b/includes/specials/SpecialRunJobs.php index e1e2049d16..cb1e892e2f 100644 --- a/includes/specials/SpecialRunJobs.php +++ b/includes/specials/SpecialRunJobs.php @@ -19,7 +19,6 @@ * * @file * @ingroup SpecialPage - * @author Aaron Schulz */ use MediaWiki\Logger\LoggerFactory; @@ -41,14 +40,10 @@ 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; } @@ -58,8 +53,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; } @@ -71,8 +67,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; }