Skip to content

Commit

Permalink
fix: do not check for file existence if image path is a url
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphjsmit committed Dec 6, 2024
1 parent 485e9a9 commit 22bb096
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Support/ImageMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace RalphJSmit\Laravel\SEO\Support;

use const FILTER_VALIDATE_URL;

use Exception;

class ImageMeta
Expand All @@ -14,6 +16,10 @@ public function __construct(string $path)
{
$publicPath = public_path($path);

if (filter_var($path, FILTER_VALIDATE_URL)) {
return;
}

if (! is_file($publicPath)) {
report(new Exception("Path {$publicPath} is not a file."));

Expand Down

0 comments on commit 22bb096

Please sign in to comment.