Skip to content

Commit

Permalink
Update ThumbnailExtension.php (#189)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarlovi authored Dec 11, 2023
1 parent ad67268 commit 377115f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Bridge/Twig/Extension/ThumbnailExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ public function getFunctions(): array

$request = $this->requestStack->getCurrentRequest();
if ($request === null) {
throw new \RuntimeException('Cannot use yassg_thumbnail without a request');
$build = true;
} else {
$build = (bool) $request->attributes->get('yassg_build', false);
}
$build = (bool) $request->attributes->get('yassg_build', false);
$url = sprintf('%1$s/insecure/%2$s%3$s', $this->imgproxyUrl, $filter, $this->encode('local:///'.ltrim($relative, '/')));
if (! $build) {
return $url;
Expand Down

0 comments on commit 377115f

Please sign in to comment.