Skip to content

Commit edac889

Browse files
Pavel Wpaveljanda
authored andcommitted
Fix: Bad variable for creating directory and checking is_writable() in getNoImage() method
1 parent adf95a7 commit edac889

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageStorage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,13 @@ public function getNoImage(bool $return_image = false): Image
253253
$new_path = sprintf('%s/%s', $this->data_path, $identifier);
254254

255255
if (!file_exists($new_path)) {
256-
$dirName = dirname($identifier);
256+
$dirName = dirname($new_path);
257257

258258
if (!file_exists($dirName)) {
259259
mkdir($dirName, 0777, true);
260260
}
261261

262-
if (!file_exists($dirName) || !is_writable($new_path)) {
262+
if (!file_exists($dirName) || !is_writable($dirName)) {
263263
throw new ImageStorageException('Could not create default no_image.png. ' . $dirName . ' does not exist or is not writable.');
264264
}
265265

0 commit comments

Comments
 (0)