You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE-5.1.md
+15Lines changed: 15 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,21 @@ Routing
59
59
* Deprecated `RouteCollectionBuilder` in favor of `RoutingConfigurator`.
60
60
* Added argument `$priority` to `RouteCollection::add()`
61
61
62
+
Security
63
+
--------
64
+
65
+
* The `is_anonymous()`, `is_remember_me()`, `is_authenticated()` and `is_fully_authenticated()` expression functions are removed. Use `is_granted()` with the correct attribute instead:
66
+
67
+
Before:
68
+
```
69
+
is_remember_me() or is_anonymous()
70
+
```
71
+
72
+
After:
73
+
```
74
+
is_granted('IS_REMEMBERED') or is_granted('IS_ANONYMOUS')
Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/ExpressionLanguageProvider.php
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,12 @@ public function getFunctions()
25
25
{
26
26
return [
27
27
newExpressionFunction('is_anonymous', function () {
28
+
@trigger_error("is_anonymous() is deprecated since version 5.1 and will be removed in 6.0. Use is_granted('IS_ANONYMOUS') instead.", E_USER_DEPRECATED);
29
+
28
30
return'$trust_resolver->isAnonymous($token)';
29
31
}, function (array$variables) {
32
+
@trigger_error("is_anonymous() is deprecated since version 5.1 and will be removed in 6.0. Use is_granted('IS_ANONYMOUS') instead.", E_USER_DEPRECATED);
newExpressionFunction('is_fully_authenticated', function () {
44
+
@trigger_error("is_fully_authenticated() is deprecated since version 5.1 and will be removed in 6.0. Use is_granted('IS_AUTHENTICATED_FULLY') instead.", E_USER_DEPRECATED);
45
+
40
46
return'$trust_resolver->isFullFledged($token)';
41
47
}, function (array$variables) {
48
+
@trigger_error("is_fully_authenticated() is deprecated since version 5.1 and will be removed in 6.0. Use is_granted('IS_AUTHENTICATED_FULLY') instead.", E_USER_DEPRECATED);
newExpressionFunction('is_remember_me', function () {
60
+
@trigger_error("is_remember_me() is deprecated since version 5.1 and will be removed in 6.0. Use is_granted('IS_REMEMBERED') instead.", E_USER_DEPRECATED);
61
+
52
62
return'$trust_resolver->isRememberMe($token)';
53
63
}, function (array$variables) {
64
+
@trigger_error("is_remember_me() is deprecated since version 5.1 and will be removed in 6.0. Use is_granted('IS_REMEMBERED') instead.", E_USER_DEPRECATED);
0 commit comments