From 0b2723feeeedc00a613dc99fc37033a494d86ca5 Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Mon, 7 Dec 2015 15:30:34 +0100 Subject: [PATCH] Strict mode only reporting 404 when failure, #127. --- README.md | 6 +++--- REVISION.md | 3 ++- webroot/img.php | 8 ++++++-- webroot/img_config.php | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 3733bef..23c3b01 100644 --- a/README.md +++ b/README.md @@ -46,14 +46,14 @@ There are several ways of installing. You either install the whole project which The [sourcode is available on GitHub](https://github.com/mosbth/cimage). Clone, fork or [download as zip](https://github.com/mosbth/cimage/archive/master.zip). -**Latest stable version is v0.7.8 released 2015-12-06.** +**Latest stable version is v0.7.9 released 2015-12-07.** I prefer cloning like this. Do switch to the latest stable version. ```bash git clone git://github.com/mosbth/cimage.git cd cimage -git checkout v0.7.8 +git checkout v0.7.9 ``` Make the cache-directory writable by the webserver. @@ -76,7 +76,7 @@ There are some all-included bundles of `img.php` that can be downloaded and used Dowload the version of your choice like this. ```bash -wget https://raw.githubusercontent.com/mosbth/cimage/v0.7.8/webroot/imgp.php +wget https://raw.githubusercontent.com/mosbth/cimage/v0.7.9/webroot/imgp.php ``` Open up the file in your editor and edit the array `$config`. Ensure that the paths to the image directory and the cache directory matches your environment, or create an own config-file for the script. diff --git a/REVISION.md b/REVISION.md index 9f6cd9b..5985afb 100644 --- a/REVISION.md +++ b/REVISION.md @@ -5,9 +5,10 @@ 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.8* (2015-12-07) +v0.7.9 (2015-12-07) ------------------------------------- +* Strict mode only reporting 404 when failure, #127. * Added correct CImage version to remote agent string, #131. * Adding CCache to improve cache handling of caching for dummy, remote and srgb. #130. diff --git a/webroot/img.php b/webroot/img.php index dada5a6..1250049 100644 --- a/webroot/img.php +++ b/webroot/img.php @@ -8,7 +8,7 @@ * */ -$version = "v0.7.8* (2015-12-06)"; +$version = "v0.7.9 (2015-12-07)"; // For CRemoteImage define("CIMAGE_USER_AGENT", "CImage/$version"); @@ -40,10 +40,14 @@ function errorPage($msg, $type = 500) header("HTTP/1.0 $header"); - if ($mode == 'development') { + if ($mode == "development") { die("[img.php] $msg"); } + if ($mode == "strict") { + $header = "404 Not Found"; + } + error_log("[img.php] $msg"); die("HTTP/1.0 $header"); } diff --git a/webroot/img_config.php b/webroot/img_config.php index b436683..b91b7e9 100644 --- a/webroot/img_config.php +++ b/webroot/img_config.php @@ -13,8 +13,9 @@ return array( * Default values: * mode: 'production' */ - //'mode' => 'production', // 'development', 'strict' - //'mode' => 'development', // 'development', 'strict' + //'mode' => 'production', + //'mode' => 'development', + //'mode' => 'strict',