bshaffer / oauth2-server-php

A library for implementing an OAuth2 Server in php
http://bshaffer.github.io/oauth2-server-php-docs
MIT License
3.26k stars 950 forks source link

At line 369 of the vendor / bshaffer / oauth2-server-php / src / OAuth2 / Response.php file has the following code: "$ sep = isset ($ parts ['query']) && count ($ parts ['query']) " and error occurs in count(), because $parts ['query'] is not an array, it's a string. #949

Closed julianaEngelmann closed 5 years ago

julianaEngelmann commented 6 years ago

If we go to the site http://php.net/manual/pt_BR/function.parse-url.php (parse_url function) we can see that the query position is a string. Is it correct to use the count ($parts ['query']) function? Because it is not an array, an error occurs. This is taking effect in the php7 version. In php5 this count is accepted.

bshaffer commented 5 years ago

Thank you for finding this! In PHP 5.x - 7.1 , this will always pass (since count returns 1 for all non-array arguments, as far as I can tell).

In PHP 7.2, this throws an error.

bshaffer commented 5 years ago

Fixed in master

julianaEngelmann commented 5 years ago

Thank you!