[php-src] Issue #12604: Built-in server assumes static content if there's a "." in the URL

From: Date: Fri, 03 Nov 2023 14:47:59 +0000
Subject: [php-src] Issue #12604: Built-in server assumes static content if there's a "." in the URL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-245733@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/12604 Author: asmecher ### Description 1. Use the built-in server 2. Place a phpinfo() script with the following code in a file called index.php in the server's root: ```php <?php phpinfo(); ``` 3. Try requesting a URL with PATH_INFO data: http://localhost:8081/anything/works/here` You should see a valid phpinfo page with the anything/works/here provided as path info data, and the index.php wrapper appropriately identified as the handling script: ![image](https://github.com/php/php-src/assets/200411/ea71620e-353f-4487-a9ea-f1c4561a6046) 4. Now, edit the URL to add a ., e.g.: http://localhost:8081/anything/works/he.re` Loading this will give a 404 page: ![image](https://github.com/php/php-src/assets/200411/d1edc7bf-4883-4869-90e7-2618b6be5046) URLs with a . in the PATH_INFO data should work equally well as those without. [The documentation](https://www.php.net/manual/en/features.commandline.webserver.php) does not mention this quirk: ![image](https://github.com/php/php-src/assets/200411/24136936-26c5-4bea-bfe5-da27bb52282a) ...but the code appears to look specifically for a .: https://github.com/php/php-src/blob/a66c926b6859fb5aaf47d400c7a2c31ba12749c5/sapi/cli/php_cli_server.c#L1458 ### PHP Version PHP 8.2.12 ### Operating System Ubuntu 20.04

« previous php.bugs (#245733) next »