diff options
Diffstat (limited to 'lib/classes/exportdocument')
| -rw-r--r-- | lib/classes/exportdocument/ExportDocument.php (renamed from lib/classes/exportdocument/ExportDocument.interface.php) | 0 | ||||
| -rw-r--r-- | lib/classes/exportdocument/ExportPDF.php (renamed from lib/classes/exportdocument/ExportPDF.class.php) | 7 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/classes/exportdocument/ExportDocument.interface.php b/lib/classes/exportdocument/ExportDocument.php index 27aaee2..27aaee2 100644 --- a/lib/classes/exportdocument/ExportDocument.interface.php +++ b/lib/classes/exportdocument/ExportDocument.php diff --git a/lib/classes/exportdocument/ExportPDF.class.php b/lib/classes/exportdocument/ExportPDF.php index 8645f5b..f676c45 100644 --- a/lib/classes/exportdocument/ExportPDF.class.php +++ b/lib/classes/exportdocument/ExportPDF.php @@ -1,7 +1,7 @@ <?php # Lifter010: TODO /** - * ExportPDF.class.php - create and export or save a pdf with simple HTML-Data + * ExportPDF.php - create and export or save a pdf with simple HTML-Data * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -115,12 +115,15 @@ class ExportPDF extends TCPDF implements ExportDocument // Fetch headers from url, handle possible redirects do { $headers = get_headers($url, true, get_default_http_stream_context($url)); + if (!$headers) { + break; + } list(, $status) = explode(' ', $headers[0]); $url = $headers['Location'] ?? $headers['location'] ?? $url; } while (in_array($status, [300, 301, 302, 303, 305, 307])); - $status = $status ?: 404; + $status = $status ?? 404; // Replace image with link on error (and not internal), otherwise return sainitized // url |
