slimphp / Slim-Psr7

PSR-7 implementation for use with Slim 4
MIT License
131 stars 45 forks source link

$_SERVER['SERVER_PORT'] server port passed as string #288

Closed LocalHeroPro closed 3 months ago

LocalHeroPro commented 1 year ago

On that line: https://github.com/slimphp/Slim-Psr7/blob/master/src/Uri.php#L301 I got error, because value passed is string "443". Can we cast string to int and after that check if it is good for us value? Value is passed starlight from $_SERVER['SERVER_PORT'] PHP Fatal error: Uncaught InvalidArgumentException: Uri port must be null or an integer between 1 and 65535 (inclusive) in vendor/slim/psr7/src/Uri.php:306