X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjob%2Fjobs%2FPublishStashedFileJob.php;h=88ac9cfffde7cc3a55d98a3168e8efef17df5912;hb=d4eefca4dd645bbef2b435ef1228a141f6a48e67;hp=5a24f93c3c1caebb2d393eb31201dcf6b675de7e;hpb=8a4524600946b1785b4b954479e94c381a0613b7;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/job/jobs/PublishStashedFileJob.php b/includes/job/jobs/PublishStashedFileJob.php index 5a24f93c3c..88ac9cfffd 100644 --- a/includes/job/jobs/PublishStashedFileJob.php +++ b/includes/job/jobs/PublishStashedFileJob.php @@ -39,6 +39,7 @@ class PublishStashedFileJob extends Job { $user = $context->getUser(); if ( !$user->isLoggedIn() ) { $this->setLastError( "Could not load the author user from session." ); + return false; } @@ -47,11 +48,12 @@ class PublishStashedFileJob extends Job { // with the session correctly. Note that being able to load // the user does not necessarily mean the session was loaded. // Most likely cause by suhosin.session.encrypt = On. - $this->setLastError( "Error associating with user session. Try setting suhosin.session.encrypt = Off" ); + $this->setLastError( "Error associating with user session. " . + "Try setting suhosin.session.encrypt = Off" ); + return false; } - UploadBase::setSessionStatus( $this->params['filekey'], array( 'result' => 'Poll', 'stage' => 'publish', 'status' => Status::newGood() ) @@ -74,6 +76,7 @@ class PublishStashedFileJob extends Job { array( 'result' => 'Failure', 'stage' => 'publish', 'status' => $status ) ); $this->setLastError( "Could not verify upload." ); + return false; } @@ -90,6 +93,7 @@ class PublishStashedFileJob extends Job { array( 'result' => 'Failure', 'stage' => 'publish', 'status' => $status ) ); $this->setLastError( $status->getWikiText() ); + return false; } @@ -121,8 +125,10 @@ class PublishStashedFileJob extends Job { ) ); $this->setLastError( get_class( $e ) . ": " . $e->getText() ); + return false; } + return true; } @@ -131,6 +137,7 @@ class PublishStashedFileJob extends Job { if ( is_array( $info['params'] ) ) { $info['params'] = array( 'filekey' => $info['params']['filekey'] ); } + return $info; }