From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/specials/SpecialRunJobs.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'includes/specials/SpecialRunJobs.php') diff --git a/includes/specials/SpecialRunJobs.php b/includes/specials/SpecialRunJobs.php index 8cf93670..286a7456 100644 --- a/includes/specials/SpecialRunJobs.php +++ b/includes/specials/SpecialRunJobs.php @@ -38,14 +38,14 @@ class SpecialRunJobs extends UnlistedSpecialPage { $this->getOutput()->disable(); if ( wfReadOnly() ) { - header( "HTTP/1.0 423 Locked" ); + // HTTP 423 Locked + HttpStatus::header( 423 ); print 'Wiki is in read-only mode'; return; } elseif ( !$this->getRequest()->wasPosted() ) { - header( "HTTP/1.0 400 Bad Request" ); + HttpStatus::header( 400 ); print 'Request must be POSTed'; - return; } @@ -55,9 +55,8 @@ class SpecialRunJobs extends UnlistedSpecialPage { $params = array_intersect_key( $this->getRequest()->getValues(), $required + $optional ); $missing = array_diff_key( $required, $params ); if ( count( $missing ) ) { - header( "HTTP/1.0 400 Bad Request" ); + HttpStatus::header( 400 ); print 'Missing parameters: ' . implode( ', ', array_keys( $missing ) ); - return; } @@ -69,9 +68,8 @@ class SpecialRunJobs extends UnlistedSpecialPage { $verified = is_string( $providedSignature ) && hash_equals( $correctSignature, $providedSignature ); if ( !$verified || $params['sigexpiry'] < time() ) { - header( "HTTP/1.0 400 Bad Request" ); + HttpStatus::header( 400 ); print 'Invalid or stale signature provided'; - return; } @@ -83,7 +81,8 @@ class SpecialRunJobs extends UnlistedSpecialPage { // but it needs to know when it is safe to disconnect. Until this // reaches ignore_user_abort(), it is not safe as the jobs won't run. ignore_user_abort( true ); // jobs may take a bit of time - header( "HTTP/1.0 202 Accepted" ); + // HTTP 202 Accepted + HttpStatus::header( 202 ); ob_flush(); flush(); // Once the client receives this response, it can disconnect -- cgit v1.2.2