php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74061 Built-in server assumes path with dot is a file
Submitted: 2017-02-08 14:06 UTC Modified: -
Votes:7
Avg. Score:4.1 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (20.0%)
From: aljosha dot papsch at vinexus dot eu Assigned:
Status: Open Package: Built-in web server
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-02-08 14:06 UTC] aljosha dot papsch at vinexus dot eu
Description:
------------
If the path contains a dot, built-in server assumes it's a file and tries to serve it. Try the test script with the following URLs. Last one will return 404 response but should route to index.php.

$ curl http://localhost:8000/
$ curl http://localhost:8000/O_o
$ curl http://localhost:8000/O.o




Test script:
---------------
<?php
echo "hello, world\n";

Expected result:
----------------
hello, world

Actual result:
--------------
<!doctype html><html><head><title>404 Not Found</title><style>
body { background-color: #fcfcfc; color: #333333; margin: 0; padding:0; }
h1 { font-size: 1.5em; font-weight: normal; background-color: #9999cc; min-height:2em; line-height:2em; border-bottom: 1px inset black; margin: 0; }
h1, p { padding-left: 10px; }
code.url { background-color: #eeeeee; font-family:monospace; padding:0 2px;}
</style>
</head><body><h1>Not Found</h1><p>The requested resource <code class="url">/ba.z</code> was not found on this server.</p></body></html>

Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-04 17:20 UTC] remi@php.net
Should have check for this bug..

So duplicate of #74205, fixed by https://github.com/php/php-src/pull/2403
 [2020-07-20 15:44 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Update .travis.yml to include PHP 7.2-7.4
On GitHub:  https://github.com/php/pecl-mail-mailparse/pull/9
Patch:      https://github.com/php/pecl-mail-mailparse/pull/9.patch
 [2020-07-20 15:45 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: protect master branches except for the pecl repos against force pushes
On GitHub:  https://github.com/php/karma/pull/4
Patch:      https://github.com/php/karma/pull/4.patch
 [2020-07-20 15:46 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Bug #64144: Process pending buildreqs during the API call that generates them.
On GitHub:  https://github.com/php/pecl-caching-memcache/pull/3
Patch:      https://github.com/php/pecl-caching-memcache/pull/3.patch
 [2020-07-20 15:47 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Create cpanel
On GitHub:  https://github.com/php/pecl-caching-memcache/pull/5
Patch:      https://github.com/php/pecl-caching-memcache/pull/5.patch
 [2020-07-20 15:48 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Don't use eregi since it was removed in PHP 7
On GitHub:  https://github.com/php/pecl-database-ibm_db2/pull/10
Patch:      https://github.com/php/pecl-database-ibm_db2/pull/10.patch
 [2020-07-20 15:49 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Remove no_separation flag w/ PHP 8
On GitHub:  https://github.com/php/pecl-database-mysql/pull/3
Patch:      https://github.com/php/pecl-database-mysql/pull/3.patch
 [2020-07-20 15:49 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Skip unnecessary installation of the test-pack
On GitHub:  https://github.com/php/pecl-file_formats-yaml/pull/52
Patch:      https://github.com/php/pecl-file_formats-yaml/pull/52.patch
 [2020-07-20 15:51 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: error message should matched path
On GitHub:  https://github.com/php/pecl-database-pdo_informix/pull/1
Patch:      https://github.com/php/pecl-database-pdo_informix/pull/1.patch
 [2020-07-20 15:52 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Removed misleading example from rowCount()
On GitHub:  https://github.com/php/doc-en/pull/56
Patch:      https://github.com/php/doc-en/pull/56.patch
 [2020-07-20 15:53 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: fix typo: mysqlx => mysqlx_x
On GitHub:  https://github.com/php/pecl-database-mysql_xdevapi/pull/8
Patch:      https://github.com/php/pecl-database-mysql_xdevapi/pull/8.patch
 [2020-07-20 15:54 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: PHP 7 adjustments
On GitHub:  https://github.com/php/pecl-database-pdo_ibm/pull/2
Patch:      https://github.com/php/pecl-database-pdo_ibm/pull/2.patch
 [2020-07-20 15:55 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Add php 7.3/7.4-beta with some travis config perfomance
On GitHub:  https://github.com/php/pecl-math-stats/pull/4
Patch:      https://github.com/php/pecl-math-stats/pull/4.patch
 [2020-07-20 15:57 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Return value of mb_regex_set_options() has changed
On GitHub:  https://github.com/php/doc-en/pull/62
Patch:      https://github.com/php/doc-en/pull/62.patch
 [2020-07-20 15:58 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Fix 8.0 compatibility
On GitHub:  https://github.com/php/pecl-networking-gearman/pull/3
Patch:      https://github.com/php/pecl-networking-gearman/pull/3.patch
 [2020-07-20 15:59 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Fix compatibility with PHP 8.0
On GitHub:  https://github.com/php/pecl-networking-ssh2/pull/42
Patch:      https://github.com/php/pecl-networking-ssh2/pull/42.patch
 [2020-07-20 16:00 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Replacement uint => uint32_t
On GitHub:  https://github.com/php/pecl-text-ereg/pull/1
Patch:      https://github.com/php/pecl-text-ereg/pull/1.patch
 [2020-07-20 16:00 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Ignore externally managed and generated files
On GitHub:  https://github.com/php/web-windows/pull/21
Patch:      https://github.com/php/web-windows/pull/21.patch
 [2020-07-20 16:02 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Subdomain now uses php logo font.
On GitHub:  https://github.com/php/web-shared/pull/1
Patch:      https://github.com/php/web-shared/pull/1.patch
 [2020-07-20 16:04 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: WIP: Prepare 2.x branch
On GitHub:  https://github.com/php/pecl-php-uploadprogress/pull/5
Patch:      https://github.com/php/pecl-php-uploadprogress/pull/5.patch
 [2020-07-20 16:04 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: mailparse_rfc822_parse_addresses() does not parse Quotes (") correctly
On GitHub:  https://github.com/php/pecl-mail-mailparse/pull/3
Patch:      https://github.com/php/pecl-mail-mailparse/pull/3.patch
 [2020-07-20 16:05 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Remove empty TSRMLS macro's
On GitHub:  https://github.com/php/pecl-search_engine-solr/pull/21
Patch:      https://github.com/php/pecl-search_engine-solr/pull/21.patch
 [2020-07-20 16:07 UTC] favatacharles at gmail dot com
The following pull request has been associated:

Patch Name: Fixed debug and disconnected callback, fixed crash when disconnected
On GitHub:  https://github.com/php/pecl-networking-ssh2/pull/37
Patch:      https://github.com/php/pecl-networking-ssh2/pull/37.patch
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 13:01:24 2020 UTC