diff --git a/function.php b/function.php index 8d17bcea..c887e49c 100644 --- a/function.php +++ b/function.php @@ -702,7 +702,9 @@ if (!function_exists('storage')) { */ function storage(?string $fileName = '', ?string $path = ''): string { - + if (!str_ends_with($path, '/')) { + $path .= '/'; + } $basePath = rtrim(Kiri::getStoragePath(), '/'); if (!empty($path)) { $path = ltrim($path, '/'); @@ -1010,7 +1012,7 @@ if (!function_exists('json_log')) { ]; $param['data'] = $data; - file_put_contents(storage('/exception-' . date('Y-m-d') . '.log','exception'), + file_put_contents(storage('exception-' . date('Y-m-d') . '.log','exception'), json_encode($param, JSON_UNESCAPED_UNICODE), FILE_APPEND); }