X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiFormatRaw.php;h=ebaeb2ce256ef19713c231af4b5822097769bcb4;hp=228b47ea651f7cb56004a98ebc51bc5d9a0f93d6;hb=c75f0e95c9888489961548c72ef24786c43838aa;hpb=24dc5218b18bfa065a101057523f39a9c046d046 diff --git a/includes/api/ApiFormatRaw.php b/includes/api/ApiFormatRaw.php index 228b47ea65..ebaeb2ce25 100644 --- a/includes/api/ApiFormatRaw.php +++ b/includes/api/ApiFormatRaw.php @@ -60,6 +60,17 @@ class ApiFormatRaw extends ApiFormatBase { return $data['mime']; } + public function getFilename() { + $data = $this->getResult()->getResultData(); + if ( isset( $data['error'] ) ) { + return $this->errorFallback->getFilename(); + } elseif ( !isset( $data['filename'] ) || $this->getIsWrappedHtml() || $this->getIsHtml() ) { + return parent::getFilename(); + } else { + return $data['filename']; + } + } + public function initPrinter( $unused = false ) { $data = $this->getResult()->getResultData(); if ( isset( $data['error'] ) || isset( $data['errors'] ) ) {