diff --git a/app/common.php b/app/common.php index e711188e..3d182061 100644 --- a/app/common.php +++ b/app/common.php @@ -153,8 +153,12 @@ if (!function_exists('get_filesystem_url')) { * @param string $disk 磁盘配置 key * @return string */ - function get_filesystem_url(string $url, string $disk): string + function get_filesystem_url(string|null $url, string $disk): string { + if (is_null($url)) { + return ''; + } + if (\think\helper\Str::startsWith($url, ['http://', 'https://', '//'])) { return $url; } @@ -171,8 +175,12 @@ if (!function_exists('url_filesystem_detect')) { * @param string $url 文件地址 * @return string */ - function url_filesystem_detect(string $url): string + function url_filesystem_detect(string|null $url): string { + if (is_null($url)) { + return ''; + } + $idx = strrpos($url, '.'); if ($idx === false) { return $url; diff --git a/public/migrate_temp_images/.gitignore b/public/migrate_temp_images/.gitignore deleted file mode 100644 index c96a04f0..00000000 --- a/public/migrate_temp_images/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file