Commit eb7be41f authored by Rolf Forst's avatar Rolf Forst
Browse files

Update File.php

parent 394abcc2
...@@ -197,7 +197,7 @@ final class File ...@@ -197,7 +197,7 @@ final class File
protected static function createFiles(string $data): bool protected static function createFiles(string $data): bool
{ {
$filePath = self::filePath(); $filePath = self::filePath();
if (!wp_mkdir_p($filePath)) { if (!$filePath || !wp_mkdir_p($filePath)) {
do_action('rrze.log.error', __('{plugin}: The directory could not be created.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$filePath' => $filePath]); do_action('rrze.log.error', __('{plugin}: The directory could not be created.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$filePath' => $filePath]);
return false; return false;
} }
...@@ -252,7 +252,6 @@ final class File ...@@ -252,7 +252,6 @@ final class File
parse_url('http://' . strtolower($_SERVER['HTTP_HOST']), PHP_URL_HOST); parse_url('http://' . strtolower($_SERVER['HTTP_HOST']), PHP_URL_HOST);
if (validate_file($path) > 0) { if (validate_file($path) > 0) {
do_action('rrze.log.error', __('{plugin}: Invalid file path.'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$path' => $path]);
return false; return false;
} }
...@@ -272,7 +271,6 @@ final class File ...@@ -272,7 +271,6 @@ final class File
parse_url(($path ? $path : $_SERVER['REQUEST_URI']), PHP_URL_PATH); parse_url(($path ? $path : $_SERVER['REQUEST_URI']), PHP_URL_PATH);
if (validate_file($path) > 0) { if (validate_file($path) > 0) {
do_action('rrze.log.error', __('{plugin}: Invalid file path.', 'rrze-cache'), ['plugin' => 'rrze-cache', 'method' => __METHOD__, '$path' => $path]);
return false; return false;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment