Skip to content

Commit

Permalink
Checking if filter exists leads to endless recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
aschempp committed Jan 17, 2025
1 parent 57bce04 commit 76a6568
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
7 changes: 1 addition & 6 deletions config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,7 @@
])
;

$services->set(NotificationCenterExtension::class)
->args([
service('twig')
])
;

$services->set(NotificationCenterExtension::class);
$services->set(NotificationCenterRuntime::class)
->args([
service(ContaoFramework::class),
Expand Down
9 changes: 0 additions & 9 deletions src/Twig/NotificationCenterExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@

class NotificationCenterExtension extends AbstractExtension
{
public function __construct(private readonly Environment $env)
{
}

public function getFunctions(): array
{
return [
Expand All @@ -24,11 +20,6 @@ public function getFunctions(): array

public function getFilters(): array
{
// Use the format_bytes filter in Contao 5
if (null !== $this->env->getFilter('format_bytes')) {
return [];
}

return [
new TwigFilter(
'format_bytes',
Expand Down

0 comments on commit 76a6568

Please sign in to comment.