Skip to content

Conversation

@brockhaus
Copy link

…equest.php

So I added a check, wether this is an array actually, else I use the port as intended as int. I would assume, that that array check is needless altogether but maybe old PHP versions needed that?

…equest.php

So I added a check, wether this is an array actually, else I use the port as intended as int. I would assume, that that array check is needless altogether but maybe old PHP versions needed that?
@CLAassistant
Copy link

CLAassistant commented Jun 2, 2021

CLA assistant check
All committers have signed the CLA.

@matthew-absops
Copy link

I do not believe this solution is sufficient. It is checking if the $port value returned by parse_url() is an array, which should never happen. I'm honestly not sure why this check was ever here, but maybe there's some history behind this built in function. Best I can tell, (parse_url($someURL))['port'] should always return an int. I believe the original intent for the check was using square brackets to access the index of a string (the first character), to ensure it wasn't a colon. Again, not sure how that would ever happen. But the proper check would be to cast the int to a string (if it's not null or is set), not see if it's an array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants