diff options
author | Andrew Dolgov <[email protected]> | 2023-08-12 09:00:57 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-08-12 09:00:57 +0300 |
commit | 83f5ab5c79b2603b8861ad312ba780f1cb3b0c1e (patch) | |
tree | a64aa8769da800dd5f0b6cd86b0d41ea19ae6bd0 | |
parent | adba0aa8d2e307e0df4ff8326ab2466b64a5073c (diff) |
fix basename() being passed a NULL value
-rw-r--r-- | classes/diskcache.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/classes/diskcache.php b/classes/diskcache.php index 6a9038289..b5c10e89d 100644 --- a/classes/diskcache.php +++ b/classes/diskcache.php @@ -243,8 +243,9 @@ class DiskCache implements Cache_Adapter { return $this->adapter->make_dir(); } + /** @param string|null $filename null means check that cache directory itself is writable */ public function is_writable(?string $filename = null): bool { - return $this->adapter->is_writable(basename($filename)); + return $this->adapter->is_writable($filename ? basename($filename) : null); } public function exists(string $filename): bool { |