if the user didn't specify the cache id, we'll delete the image and not keep it
This commit is contained in:
parent
193cf828c2
commit
a51de98781
7
api.php
7
api.php
@ -45,9 +45,7 @@ switch ($type) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!$cache)
|
$hash = 'c'.$cache.'-'.preg_replace("/[^A-Za-z0-9 ]/", '', $url).'.'.$ft;
|
||||||
$cache = md5(time().rand(1,2000));
|
|
||||||
$hash = $cache.'-'.preg_replace("/[^A-Za-z0-9 ]/", '', $url).'.'.$ft;
|
|
||||||
|
|
||||||
if(!is_dir(__DIR__.'/cache/'))
|
if(!is_dir(__DIR__.'/cache/'))
|
||||||
mkdir(__DIR__.'/cache/');
|
mkdir(__DIR__.'/cache/');
|
||||||
@ -89,6 +87,9 @@ else if($ft=='png')
|
|||||||
|
|
||||||
imagedestroy($res);
|
imagedestroy($res);
|
||||||
|
|
||||||
|
if(!$cache)
|
||||||
|
unlink($file);
|
||||||
|
|
||||||
|
|
||||||
function isBase64($data)
|
function isBase64($data)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user