1
0
mirror of https://github.com/mosbth/cimage.git synced 2025-07-25 10:41:35 +02:00

* Cache-directory can now be readonly and serve all cached files, still failing when need to save files. #5

This commit is contained in:
Mikael Roos
2014-11-21 22:31:04 +01:00
parent ba45f746bb
commit 08ee3064d0
2 changed files with 6 additions and 0 deletions

View File

@@ -296,8 +296,10 @@ class CImage
$this->saveFolder = $dir;
$this->cacheFileName = $dir . '/' . $src;
/* Allow readonly cache
is_writable($this->saveFolder)
or $this->raiseError('Target directory is not writable.');
*/
// Sanitize filename
$this->cacheFileName = preg_replace('/^a-zA-Z0-9\.-_/', '', $this->cacheFileName);
@@ -1462,6 +1464,9 @@ class CImage
$this->setTarget($src, $base);
}
is_writable($this->saveFolder)
or $this->raiseError('Target directory is not writable.');
switch(strtolower($this->extension)) {
case 'jpeg':

View File

@@ -133,6 +133,7 @@ Revision history
v0.5.x (latest)
* Cache-directory can now be readonly and serve all cached files, still failing when need to save files. #5
* Cache now uses same file extension as original image #37.
* Can output image as json format using `json` #11.