From 8d10a9a6540dfe526abe7ab00e7697800e2447d2 Mon Sep 17 00:00:00 2001 From: oesi Date: Wed, 8 Jun 2016 18:14:30 +0200 Subject: [PATCH] =?UTF-8?q?Fehlerbehandlung=20bei=20Dokumentenexport=20hin?= =?UTF-8?q?zugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/dokument_export.class.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/dokument_export.class.php b/include/dokument_export.class.php index f60f94c3e..89ccfea65 100644 --- a/include/dokument_export.class.php +++ b/include/dokument_export.class.php @@ -291,6 +291,9 @@ class dokument_export if($download) { + if(headers_sent()) + exit('Header wurden bereits gesendet -> Abbruch'); + switch($this->outputformat) { case 'pdf': @@ -310,6 +313,8 @@ class dokument_export header('Content-Disposition: attachment; filename="'.$this->filename.'.odt"'); header('Content-Length: '.$fsize); break; + default: + exit('Outputformat is not defined'); } while (!feof($handle)) @@ -389,5 +394,11 @@ class dokument_export } return $_xml_data->asXML(); } + + public function getXML() + { + $this->xml_data->formatOutput=true; + return $this->xml_data->saveXML(); + } } ?>