X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFormatRaw.php;h=228b47ea651f7cb56004a98ebc51bc5d9a0f93d6;hb=2b7d97e6a49c46eeb0e1018dd51ae5e79b2f373e;hp=9da040ca0b20dbf413ab6d7ef1fc520b3d60dc14;hpb=052770c40b84e22ddd42ff5686e0aaf3b9131030;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFormatRaw.php b/includes/api/ApiFormatRaw.php index 9da040ca0b..228b47ea65 100644 --- a/includes/api/ApiFormatRaw.php +++ b/includes/api/ApiFormatRaw.php @@ -49,7 +49,7 @@ class ApiFormatRaw extends ApiFormatBase { public function getMimeType() { $data = $this->getResult()->getResultData(); - if ( isset( $data['error'] ) ) { + if ( isset( $data['error'] ) || isset( $data['errors'] ) ) { return $this->errorFallback->getMimeType(); } @@ -62,7 +62,7 @@ class ApiFormatRaw extends ApiFormatBase { public function initPrinter( $unused = false ) { $data = $this->getResult()->getResultData(); - if ( isset( $data['error'] ) ) { + if ( isset( $data['error'] ) || isset( $data['errors'] ) ) { $this->errorFallback->initPrinter( $unused ); if ( $this->mFailWithHTTPError ) { $this->getMain()->getRequest()->response()->statusHeader( 400 ); @@ -74,7 +74,7 @@ class ApiFormatRaw extends ApiFormatBase { public function closePrinter() { $data = $this->getResult()->getResultData(); - if ( isset( $data['error'] ) ) { + if ( isset( $data['error'] ) || isset( $data['errors'] ) ) { $this->errorFallback->closePrinter(); } else { parent::closePrinter(); @@ -83,7 +83,7 @@ class ApiFormatRaw extends ApiFormatBase { public function execute() { $data = $this->getResult()->getResultData(); - if ( isset( $data['error'] ) ) { + if ( isset( $data['error'] ) || isset( $data['errors'] ) ) { $this->errorFallback->execute(); return; }