Type Error: count(): Argument #1 ($value) must be of type Countable|array, null given

Created on 17 August 2023, over 1 year ago
Updated 8 August 2024, 8 months ago

After migrating to php 8 I saw the following errors when authenticating:

TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given in count() (line 267 of /sites/all/libraries/oauth2-server-php/src/OAuth2/Response.php).

and

TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count() (line 460 of /sites/all/libraries/oauth2-server-php/src/OAuth2/Server.php).

Fixed both by adding is_countable() check into the conditions.

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia sano

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024