fixed messedup filename for non-cached images
This commit is contained in:
parent
a51de98781
commit
eceaec3df9
5
api.php
5
api.php
@ -45,7 +45,9 @@ switch ($type) {
|
||||
|
||||
|
||||
|
||||
$hash = 'c'.$cache.'-'.preg_replace("/[^A-Za-z0-9 ]/", '', $url).'.'.$ft;
|
||||
$hash = $cache.'-'.preg_replace("/[^A-Za-z0-9 ]/", '', $url).'.'.$ft;
|
||||
if(!$cache)
|
||||
$hash = md5(time().rand(1,2000)).$hash;
|
||||
|
||||
if(!is_dir(__DIR__.'/cache/'))
|
||||
mkdir(__DIR__.'/cache/');
|
||||
@ -90,7 +92,6 @@ imagedestroy($res);
|
||||
if(!$cache)
|
||||
unlink($file);
|
||||
|
||||
|
||||
function isBase64($data)
|
||||
{
|
||||
if ( base64_encode(base64_decode($data, true)) === $data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user