Bug #75302 [Opn->Dup]: php file downlaod
Edit report at https://bugs.php.net/bug.php?id=75302&edit=1
ID: 75302
Updated by: cmb@php.net
Reported by: franciszek dot witt at protonmail dot com
Summary: php file downlaod
-Status: Open
+Status: Duplicate
Type: Bug
Package: Built-in web server
Operating System: Windows
PHP Version: 7.1.10
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Closing as duplicate of bug #77932 (which is fixed as of PHP
7.3.22 and 7.4.10, respectively).
Previous Comments:
------------------------------------------------------------------------
[2017-10-24 19:32:08] esminis at esminis dot lt
Yea it is not Windows (in this specific case it is Android app "Server for PHP" - PHP
compiled for Android; btw it will happen in any system that uses case insensitive filesystem).
And I don`t think there is any need of patch cause it is simple replace of one function name in
sapi/cli/php_cli_server.c:
memcmp(client->request.ext, "php", 3) should be replaced with
strncasecmp(client->request.ext, "php", 3)
This should be double checked by someone who knows well PHP source code
------------------------------------------------------------------------
[2017-10-22 20:00:16] ab@php.net
Thanks for the report. I don't think it's a Windows bug, as 7.1 and even since 5.5 or
earlier doesn't support non NTFS based Windows versions. There are still OSes supporting FSes
with no case sensitivity, though. The code in the description sounds reasonable, but I've no
such system at hand to test the actual behaviors. If one would provide a patch that at least
doesn't breach the current functionality, it could be evaluated.
Thanks.
------------------------------------------------------------------------
[2017-10-01 18:19:34] esminis at esminis dot lt
More info - this bug is in PHP built-in server (only possible workaround without changing source
code of PHP for now is to enable router script).
I am the developer who helped identify this bug (contact on email if needed).
------------------------------------------------------------------------
[2017-10-01 16:59:58] franciszek dot witt at protonmail dot com
Description:
------------
In some machines with FAT file system if you type file.PHP (PHP uppercase) instead of file.php it
will start downloading source code. Tested on android PHP webserver but developer said that
it's general php bug.
Part of email wich he sent to me
"
Hi, Yes it is a bug of PHP itself, the reason is that in file: sapi/cli/php_cli_server.c It is used
'memcmp(client->request.ext, "php", 3)' instead of
'strncasecmp(client->request.ext, "php", 3)' (it should ignore
"php" case, but it does not as of now) This happens only if filesystem is case insesintive
(for example FAT)
"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75302&edit=1
Thread (5 messages)