Skip to content

Commit 56d364a

Browse files
committed
Check if $path is not an URL to verify file exists
1 parent 4105233 commit 56d364a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPImageWorkshop/ImageWorkshop.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class ImageWorkshop
5555
*/
5656
public static function initFromPath($path, $fixOrientation = false)
5757
{
58-
if (!file_exists($path)) {
58+
if (false === filter_var($path, FILTER_VALIDATE_URL) && !file_exists($path)) {
5959
throw new ImageWorkshopException(sprintf('File "%s" not exists.', $path), static::ERROR_IMAGE_NOT_FOUND);
6060
}
6161

0 commit comments

Comments
 (0)