From e4820d048fd878730b994579b2e8dc719ef9c04f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 18 Jun 2019 20:30:18 +0200 Subject: [PATCH] Stop `exit`ing when no output was created in ExportMailAddressUserBulkProcessingAction --- ...ExportMailAddressUserBulkProcessingAction.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; } } -- 2.20.1