Skip to content

Commit

Permalink
parse_url already handles query logic, use that.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Dec 12, 2024
1 parent a07eb19 commit cd58407
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Imaging/ImageGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ private function doGenerateByUrl($url, array $params)
$this->skip_validation = true;
$this->setParams($params);

$qs = Str::contains($url, '?') ? Str::after($url, '?') : null;
$parsed = $this->parseUrl($url);
$qs = $parsed['query'];

$this->server->setSource($this->guzzleSourceFilesystem($parsed['base']));
$this->server->setSourcePathPrefix('/');
Expand Down Expand Up @@ -331,6 +331,7 @@ private function parseUrl($url)
return [
'path' => Str::after($parsed['path'], '/'),
'base' => $parsed['scheme'].'://'.$parsed['host'],
'query' => $parsed['query'] ?? null,
];
}
}

0 comments on commit cd58407

Please sign in to comment.