Update Tools.php

This commit is contained in:
Anyon 2022-04-18 14:01:14 +08:00
parent 34412f58fb
commit 6f978d1dfd

View File

@ -364,12 +364,12 @@ class Tools
$build = false; $build = false;
$mycurl = new MyCurlFile((array)$value); $mycurl = new MyCurlFile((array)$value);
$data[$key] = $mycurl->get(); $data[$key] = $mycurl->get();
array_push(self::$cache_curl, $mycurl->tempname); self::$cache_curl[] = $mycurl->tempname;
} elseif (is_array($value) && isset($value['datatype']) && $value['datatype'] === 'MY_CURL_FILE') { } elseif (is_array($value) && isset($value['datatype']) && $value['datatype'] === 'MY_CURL_FILE') {
$build = false; $build = false;
$mycurl = new MyCurlFile($value); $mycurl = new MyCurlFile($value);
$data[$key] = $mycurl->get(); $data[$key] = $mycurl->get();
array_push(self::$cache_curl, $mycurl->tempname); self::$cache_curl[] = $mycurl->tempname;
} elseif (is_string($value) && class_exists('CURLFile', false) && stripos($value, '@') === 0) { } elseif (is_string($value) && class_exists('CURLFile', false) && stripos($value, '@') === 0) {
if (($filename = realpath(trim($value, '@'))) && file_exists($filename)) { if (($filename = realpath(trim($value, '@'))) && file_exists($filename)) {
$build = false; $build = false;
@ -451,7 +451,7 @@ class Tools
return call_user_func_array(self::$cache_callable['del'], func_get_args()); return call_user_func_array(self::$cache_callable['del'], func_get_args());
} }
$file = self::_getCacheName($name); $file = self::_getCacheName($name);
return file_exists($file) ? unlink($file) : true; return !file_exists($file) || @unlink($file);
} }
/** /**