Edit report at https://bugs.php.net/bug.php?id=60180&edit=1
ID: 60180 Updated by: larue...@php.net Reported by: david dot gero at ec dot gc dot ca Summary: $_SERVER["PHP_SELF"] incorrect -Status: Assigned +Status: Closed Type: Bug Package: Built-in web server Operating System: Windows XP with SP3 PHP Version: 5.4SVN-2011-10-31 (snap) Assigned To: laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2011-11-01 12:23:58] larue...@php.net Automatic comment from SVN on behalf of laruence Revision: http://svn.php.net/viewvc/?view=revision&revision=318639 Log: Fixed Bug #60180 ($_SERVER["PHP_SELF"] incorrect) ------------------------------------------------------------------------ [2011-10-31 17:40:58] david dot gero at ec dot gc dot ca Should have said that the snap was tested with the built-in PHP web server, and I was comparing it against the standard Apache + PHP setup ------------------------------------------------------------------------ [2011-10-31 17:25:21] david dot gero at ec dot gc dot ca Description: ------------ When going to, for example, /admin/phpinfo.php/foo/bar?foo=bar, you should get the following (using Apache and PHP on Windows XP): $_SERVER["REQUEST_URI"] == "/admin/phpinfo.php/foo/bar?foo=bar" $_SERVER["PHP_SELF"] == "/admin/phpinfo.php/foo/bar" $_SERVER["SCRIPT_NAME"] == "/admin/phpinfo.php" $_SERVER["PATH_INFO"] == "/foo/bar" $_SERVER["QUERY_STRING"] == "foo=bar" In the snap for October 31, 2011, REQUEST_URI, PATH_INFO and QUERY_STRING are correct, but the following are wrong: $_SERVER["PHP_SELF"] == "\admin\phpinfo.php" (slashes incorrectly replaced by backslashes, and PATH_INFO ending has been incorrectly removed) $_SERVER["SCRIPT_NAME"] == (missing completely) Test script: --------------- phpinfo.php file contains: <?php phpinfo(); ?> Expected result: ---------------- Going to /admin/phpinfo.php/foo/bar?foo=bar should get: $_SERVER["REQUEST_URI"] == "/admin/phpinfo.php/foo/bar?foo=bar" $_SERVER["PHP_SELF"] == "/admin/phpinfo.php/foo/bar" $_SERVER["SCRIPT_NAME"] == "/admin/phpinfo.php" $_SERVER["PATH_INFO"] == "/foo/bar" $_SERVER["QUERY_STRING"] == "foo=bar" Actual result: -------------- $_SERVER["REQUEST_URI"] == "/admin/phpinfo.php/foo/bar?foo=bar" (correct) $_SERVER["PHP_SELF"] == "\admin\phpinfo.php" (incorrect) $_SERVER["SCRIPT_NAME"] == (not set) $_SERVER["PATH_INFO"] == "/foo/bar" (correct) $_SERVER["QUERY_STRING"] == "foo=bar" (correct) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60180&edit=1