fixed messedup filename for non-cached images

This commit is contained in:
Christian Haschek 2015-09-28 16:02:20 +02:00
parent a51de98781
commit eceaec3df9

View File

@ -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/')) if(!is_dir(__DIR__.'/cache/'))
mkdir(__DIR__.'/cache/'); mkdir(__DIR__.'/cache/');
@ -90,7 +92,6 @@ imagedestroy($res);
if(!$cache) if(!$cache)
unlink($file); unlink($file);
function isBase64($data) function isBase64($data)
{ {
if ( base64_encode(base64_decode($data, true)) === $data) if ( base64_encode(base64_decode($data, true)) === $data)