From ad5fa11e6a0c5411a3dfe53292db7284947cc529 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 23 Oct 2024 22:20:41 +0100 Subject: [PATCH] Support glide urls with URL params --- src/Imaging/GlideManager.php | 1 + src/Imaging/ImageGenerator.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Imaging/GlideManager.php b/src/Imaging/GlideManager.php index ef36459de7..daa88be4d7 100644 --- a/src/Imaging/GlideManager.php +++ b/src/Imaging/GlideManager.php @@ -167,6 +167,7 @@ private function getCachePathCallable() $hashCallable = $this->getHashCallable(); return function ($path, $params) use ($hashCallable) { + $path = Str::before($path, '?'); $sourcePath = $this->getSourcePath($path); if ($this->sourcePathPrefix) { diff --git a/src/Imaging/ImageGenerator.php b/src/Imaging/ImageGenerator.php index bd38934577..490926e844 100644 --- a/src/Imaging/ImageGenerator.php +++ b/src/Imaging/ImageGenerator.php @@ -118,13 +118,14 @@ private function doGenerateByUrl($url, array $params) $this->skip_validation = true; $this->setParams($params); + $qs = Str::after($url, '?'); $parsed = $this->parseUrl($url); $this->server->setSource($this->guzzleSourceFilesystem($parsed['base'])); $this->server->setSourcePathPrefix('/'); $this->server->setCachePathPrefix('http'); - return $this->generate($parsed['path']); + return $this->generate($parsed['path'].($qs ? '?'.$qs : '')); } /**