Skip to content

Commit

Permalink
Fix: Bad variable for creating directory and checking is_writable() i…
Browse files Browse the repository at this point in the history
…n getNoImage() method
  • Loading branch information
Pavel W authored and paveljanda committed Apr 29, 2020
1 parent adf95a7 commit edac889
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ImageStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,13 @@ public function getNoImage(bool $return_image = false): Image
$new_path = sprintf('%s/%s', $this->data_path, $identifier);

if (!file_exists($new_path)) {
$dirName = dirname($identifier);
$dirName = dirname($new_path);

if (!file_exists($dirName)) {
mkdir($dirName, 0777, true);
}

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

Expand Down

0 comments on commit edac889

Please sign in to comment.