Skip to content

Commit

Permalink
exif: add path and file readability checks
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <radialapps@gmail.com>
  • Loading branch information
pulsejet committed Mar 10, 2024
1 parent 8eacf72 commit 1e4f969
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Exif.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,16 @@ public static function getExifFromFile(File $file): array
throw new \Exception('Failed to get local file: '.$ex->getMessage());
}

// Check if path is valid
if (!\is_string($path)) {
throw new \Exception('Failed to get local file path');
}

// Check if file is readable
if (!is_readable($path)) {
throw new \Exception('File is not readable');
}

$exif = self::getExifFromLocalPath($path);

// We need to remove blacklisted fields to prevent leaking info
Expand Down

0 comments on commit 1e4f969

Please sign in to comment.