From ad4930c3aeb3e3f1fc2789861223d833a3f7fe11 Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Mon, 7 Dec 2015 17:39:34 +0100 Subject: [PATCH] Fix strict mode only reporting 404 when failure, #127. --- REVISION.md | 6 ++++++ webroot/img.php | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/REVISION.md b/REVISION.md index 5985afb..0acdbd4 100644 --- a/REVISION.md +++ b/REVISION.md @@ -5,6 +5,12 @@ Revision history [![Build Status](https://scrutinizer-ci.com/g/mosbth/cimage/badges/build.png?b=master)](https://scrutinizer-ci.com/g/mosbth/cimage/build-status/master) +v0.7.9* (2015-12-07) +------------------------------------- + +* Fix strict mode only reporting 404 when failure, #127. + + v0.7.9 (2015-12-07) ------------------------------------- diff --git a/webroot/img.php b/webroot/img.php index 553c604..6d06284 100644 --- a/webroot/img.php +++ b/webroot/img.php @@ -8,7 +8,7 @@ * */ -$version = "v0.7.9 (2015-12-07)"; +$version = "v0.7.9* (2015-12-07)"; // For CRemoteImage define("CIMAGE_USER_AGENT", "CImage/$version"); @@ -38,16 +38,16 @@ function errorPage($msg, $type = 500) $header = "500 Internal Server Error"; } + if ($mode == "strict") { + $header = "404 Not Found"; + } + header("HTTP/1.0 $header"); if ($mode == "development") { die("[img.php] $msg"); } - if ($mode == "strict") { - $header = "404 Not Found"; - } - error_log("[img.php] $msg"); die("HTTP/1.0 $header"); }