From f8288b710e1090d88dcacb0fa28823cdbe14072a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Fri, 12 Jul 2019 02:28:47 +0200 Subject: [PATCH] thumb: ensure exception message in X-Error header Multiline convert warnings would be ignored; the first line should suffice. Include the expected header regardless of fallback output. --- thumb/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thumb/index.php b/thumb/index.php index 24f46cc..27a194e 100644 --- a/thumb/index.php +++ b/thumb/index.php @@ -17,9 +17,9 @@ try { } catch (Throwable $e) { http_response_code($e->getCode() ?: 500); + header("X-Error: ".explode("\n", $e->getMessage())[0], FALSE); $target = '500.png'; if (file_exists($target)) { - header("X-Error: ".$e->getMessage()); header('Content-type: '.mime_content_type($target)); readfile($target); exit; -- 2.30.0