@@ -125,17 +125,17 @@ public function indexAction(Request $request): Response
125
125
// "application/x-www-form-urlencoded" format
126
126
//
127
127
// so if redirectUri is not already set, we try to set request redirect_uri params, fallback to first redirectUri of client
128
- /** @psalm-suppress RiskyTruthyFalsyComparison !empty($e->getHint()),empty($e->getRedirectUri()) we really want to check null and empty */
129
- if (isset ($ client ) && $ client !== null
128
+ if (isset ($ client ) && null !== $ client
130
129
&& ('invalid_client ' === $ e ->getErrorType ()
131
- || ('invalid_request ' === $ e ->getErrorType () && ! empty ($ e ->getHint ())
130
+ || ('invalid_request ' === $ e ->getErrorType () && null !== $ e -> getHint () && 0 < \strlen ($ e ->getHint ())
132
131
&& !\in_array (sscanf ($ e ->getHint () ?? '' , 'Check the `%s` parameter ' )[0 ] ?? null , ['client_id ' , 'client_secret ' , 'redirect_uri ' ])))
133
- && empty ( $ e ->getRedirectUri ())) {
132
+ && ( null === $ e ->getRedirectUri () || 0 === \strlen ( $ e -> getRedirectUri () ))) {
134
133
/** @var \League\Bundle\OAuth2ServerBundle\Model\ClientInterface $client */
135
134
$ redirectUri = $ request ->query ->get ('redirect_uri ' , // query string has priority
136
- (string )$ request ->request ->get ('redirect_uri ' , // then we check body to support POST request
137
- $ client ->getRedirectUris ()[0 ]?->__toString() ?? '' )); // then first client redirect uri
138
- if (!empty ($ redirectUri )) {
135
+ (string ) $ request ->request ->get ('redirect_uri ' , // then we check body to support POST request
136
+ $ client ->getRedirectUris ()[0 ]?->__toString() ?? '' ) // then first client redirect uri
137
+ );
138
+ if (0 < \strlen ($ redirectUri )) {
139
139
$ e = new OAuthServerException (
140
140
$ e ->getMessage (),
141
141
$ e ->getCode (),
0 commit comments