From: Tim Düsterhus Date: Tue, 18 Jun 2019 18:30:18 +0000 (+0200) Subject: Stop `exit`ing when no output was created in ExportMailAddressUserBulkProcessingAction X-Git-Tag: 5.2.0_Alpha_1~19^2~2^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4820d048fd878730b994579b2e8dc719ef9c04f;p=GitHub%2FWoltLab%2FWCF.git Stop `exit`ing when no output was created in ExportMailAddressUserBulkProcessingAction --- diff --git a/wcfsetup/install/files/lib/system/bulk/processing/user/ExportMailAddressUserBulkProcessingAction.class.php b/wcfsetup/install/files/lib/system/bulk/processing/user/ExportMailAddressUserBulkProcessingAction.class.php index aa45c14013..a09d87c03b 100644 --- a/wcfsetup/install/files/lib/system/bulk/processing/user/ExportMailAddressUserBulkProcessingAction.class.php +++ b/wcfsetup/install/files/lib/system/bulk/processing/user/ExportMailAddressUserBulkProcessingAction.class.php @@ -33,6 +33,12 @@ class ExportMailAddressUserBulkProcessingAction extends AbstractUserBulkProcessi */ public $textSeparator = '"'; + /** + * indicates whether output was generated (i.e. executeAction was called) + * @var boolean + */ + private $executed = false; + /** * @inheritDoc */ @@ -41,6 +47,8 @@ class ExportMailAddressUserBulkProcessingAction extends AbstractUserBulkProcessi throw new \InvalidArgumentException("Object list is no instance of '".UserList::class."', instance of '".get_class($objectList)."' given."); } + $this->executed = true; + // send content type header('Content-Type: text/'.$this->fileType.'; charset=UTF-8'); header('Content-Disposition: attachment; filename="export.'.$this->fileType.'"'); @@ -102,6 +110,8 @@ class ExportMailAddressUserBulkProcessingAction extends AbstractUserBulkProcessi * @inheritDoc */ public function reset() { + if (!$this->executed) return; + $this->executed = false; exit; } }