mirror of
https://github.com/mosbth/cimage.git
synced 2025-08-01 05:50:12 +02:00
Changing CImage::output()
as proposed in #37.
This commit is contained in:
11
CImage.php
11
CImage.php
@@ -1547,10 +1547,8 @@ class CImage
|
|||||||
|
|
||||||
$this->log("Outputting image: $file");
|
$this->log("Outputting image: $file");
|
||||||
|
|
||||||
// Get details on image
|
// Get image modification time
|
||||||
$info = list($width, $height, $type, $attr) = getimagesize($file);
|
clearstatcache();
|
||||||
!empty($info) or $this->raiseError("The file doesn't seem to be an image.");
|
|
||||||
$mime = $info['mime'];
|
|
||||||
$lastModified = filemtime($file);
|
$lastModified = filemtime($file);
|
||||||
$gmdate = gmdate("D, d M Y H:i:s", $lastModified);
|
$gmdate = gmdate("D, d M Y H:i:s", $lastModified);
|
||||||
|
|
||||||
@@ -1576,6 +1574,11 @@ class CImage
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get details on image
|
||||||
|
$info = getimagesize($file);
|
||||||
|
!empty($info) or $this->raiseError("The file doesn't seem to be an image.");
|
||||||
|
$mime = $info['mime'];
|
||||||
|
|
||||||
header('Content-type: ' . $mime);
|
header('Content-type: ' . $mime);
|
||||||
readfile($file);
|
readfile($file);
|
||||||
}
|
}
|
||||||
|
@@ -133,6 +133,7 @@ Revision history
|
|||||||
|
|
||||||
v0.5.x (latest)
|
v0.5.x (latest)
|
||||||
|
|
||||||
|
* Changing `CImage::output()` as proposed in #37.
|
||||||
* Adding security check that image filename is always below the path `image_path` as specified in `img_config.php` #37.
|
* Adding security check that image filename is always below the path `image_path` as specified in `img_config.php` #37.
|
||||||
* Adding configuration item in `img_config.php` for setting valid characters in image filename.
|
* Adding configuration item in `img_config.php` for setting valid characters in image filename.
|
||||||
* Moving `webroot/test*` into directory `webroot/test`.
|
* Moving `webroot/test*` into directory `webroot/test`.
|
||||||
|
Reference in New Issue
Block a user