diff --git a/api.php b/api.php index 38a4a2c..5a8bf30 100644 --- a/api.php +++ b/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)