Skip to content

Commit

Permalink
bug #4032 Add twig_escape_filter_is_safe() as deprecated. (brummbar)
Browse files Browse the repository at this point in the history
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Add twig_escape_filter_is_safe() as deprecated.

Fix for #4031

Commits
-------

1170144 Add twig_escape_filter_is_safe() as deprecated.
  • Loading branch information
fabpot committed Apr 17, 2024
2 parents c145871 + 1170144 commit 7d2b814
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Resources/escaper.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@

use Twig\Environment;
use Twig\Extension\EscaperExtension;
use Twig\Node\Node;

/**
* @internal
*
* @deprecated since Twig 3.9
*/
function twig_raw_filter($string)
Expand All @@ -25,6 +27,7 @@ function twig_raw_filter($string)

/**
* @internal
*
* @deprecated since Twig 3.9
*/
function twig_escape_filter(Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false)
Expand All @@ -33,3 +36,15 @@ function twig_escape_filter(Environment $env, $string, $strategy = 'html', $char

return EscaperExtension::escape($env, $string, $strategy, $charset, $autoescape);
}

/**
* @internal
*
* @deprecated since Twig 3.9
*/
function twig_escape_filter_is_safe(Node $filterArgs)
{
trigger_deprecation('twig/twig', '3.9', 'Using the internal "%s" function is deprecated.', __FUNCTION__);

return EscaperExtension::escapeFilterIsSafe($filterArgs);
}

0 comments on commit 7d2b814

Please sign in to comment.