Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glide Tag: NotFoundHttpException when external src url contains query params #7172

Open
o1y opened this issue Dec 6, 2022 · 0 comments · May be fixed by #11003
Open

Glide Tag: NotFoundHttpException when external src url contains query params #7172

o1y opened this issue Dec 6, 2022 · 0 comments · May be fixed by #11003
Labels

Comments

@o1y
Copy link
Contributor

o1y commented Dec 6, 2022

Bug description

A NotFoundHttpException is thrown when using an external src url in a glide tag which contains query params.

How to reproduce

{{ glide src="https://preview.redd.it/iip9f4nhuu3a1.png?width=960&crop=smart&auto=webp&s=25d64e2a3eca5ff6458868122b44d13627d28360" square="640" quality="80" }}
  <img src="{{ url }}">
{{ /glide }}

Logs

Symfony\Component\ErrorHandler\Error\FatalError
Uncaught Statamic\Exceptions\NotFoundHttpException in /var/www/vendor/statamic/cms/src/Imaging/ImageGenerator.php:264
Stack trace: 
#0 /var/www/vendor/statamic/cms/src/Imaging/ImageGenerator.php(130): Statamic\Imaging\ImageGenerator->generate()
#1 /var/www/vendor/statamic/cms/src/Imaging/ImageGenerator.php(117): Statamic\Imaging\ImageGenerator->doGenerateByUrl() 
#2 /var/www/vendor/laravel/framework/src/Illuminate/Cache/Repository.php(426): Statamic\Imaging\ImageGenerator->Statamic\Imaging\{closure}() 
#3 /var/www/vendor/statamic/cms/src/Imaging/ImageGenerator.php(118): Illuminate\Cache\Repository->rememberForever() 
#4 /var/www/vendor/statamic/cms/src/Tags/Glide.php(163): Statamic\Imaging\ImageGenerator->generateByUrl() 
#5 /var/www/vendor/statamic/cms/src/Tags/Glide.php(137): Statamic\Tags\Glide->generateImage() 
#6 [internal function]: Statamic\Tags\Glide->Statamic\Tags\{closure}() 
#7 /var/www/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(695): array_map() 
#8 /var/www/vendor/statamic/cms/src/Tags/Glide.php(147): Illuminate\Support\Collection->map() 
#9 [internal function]: Statamic\Tags\Glide->generate() 
#10 /var/www/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(1458): call_user_func() 
#11 /var/www/vendor/statamic/cms/src/View/Antlers/Language/Runtime/NodeProcessor.php(702): Statamic\View\Antlers\Language\Runtime\NodeProcessor->reduce() 
#12 /var/www/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(382): Statamic\View\Antlers\Language\Runtime\NodeProcessor->render() 
#13 /var/www/vendor/statamic/cms/src/View/Antlers/Language/Runtime/RuntimeParser.php(760): Statamic\View\Antlers\Language\Runtime\RuntimeParser->renderText() 
#14 /var/www/vendor/statamic/cms/src/View/Antlers/Engine.php(97): Statamic\View\Antlers\Language\Runtime\RuntimeParser->parseView() 
#15 /var/www/vendor/laravel/framework/src/Illuminate/View/View.php(139): Statamic\View\Antlers\Engine->get() 
#16 /var/www/vendor/laravel/framework/src/Illuminate/View/View.php(122): Illuminate\View\View->getContents() 
#17 /var/www/vendor/laravel/framework/src/Illuminate/View/View.php(91): Illuminate\View\View->renderContents() 
#18 /var/www/vendor/statamic/cms/src/View/View.php(110): Illuminate\View\View->render() 
#19 /var/www/vendor/statamic/cms/src/Exceptions/NotFoundHttpException.php(28): Statamic\View\View->render() 
#20 /var/www/vendor/statamic/cms/src/Exceptions/NotFoundHttpException.php(18): Statamic\Exceptions\NotFoundHttpException->contents() 
#21 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(326): Statamic\Exceptions\NotFoundHttpException->render() 
#22 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(196): Illuminate\Foundation\Exceptions\Handler->render() 
#23 /var/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(173): Illuminate\Foundation\Bootstrap\HandleExceptions->renderHttpResponse() 
#24 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException() 
#25 {main} thrown

Environment

Statamic 3.3.60 Solo
Laravel 8.83.26
PHP 8.1.10

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

None

Additional details

Statamic\Imaging\ImageGenerator removes any query params from given src.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants