Edit report at http://bugs.php.net/bug.php?id=51627&edit=1
ID: 51627 Updated by: fel...@php.net Reported by: russell dot tempero at rightnow dot com Summary: script path not correctly evaluated -Status: Open +Status: Closed Type: Bug Package: CGI related Operating System: Linux PHP Version: 5.3.2 -Assigned To: +Assigned To: felipe 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/. Thank you for the report, and for helping us make PHP better. Thanks for the patch! Previous Comments: ------------------------------------------------------------------------ [2010-04-22 00:22:33] fel...@php.net Automatic comment from SVN on behalf of felipe Revision: http://svn.php.net/viewvc/?view=revision&revision=298277 Log: - Fixed bug #51627 (script path not correctly evaluated) Patch by: russell dot tempero at rightnow dot com ------------------------------------------------------------------------ [2010-04-21 23:28:42] russell dot tempero at rightnow dot com Description: ------------ Using PHP as CGI (not FastCGI). Pertinent php.ini values: include_path="/home/httpd/cgi-bin/rcttrunk1.cfg/scripts:." doc_root="/home/httpd/cgi-bin/rcttrunk1.cfg/scripts" Path to file: /home/httpd/cgi-bin/rcttrunk1.cfg/scripts/admin/launch.php When I hit the following URL, I get a "file not found" error: http://<server_name>/cgi-bin/rcttrunk1.cfg/php/admin/launch.php Please see my patch below to fix the issue. The problem is that length is evaluating to 1, rather than string length, because of operator precedence. The solution is to wrap (length = strlen(...)) in its own set of parentheses. Test script: --------------- Happens for any script. Expected result: ---------------- The page loads. Actual result: -------------- "File not found." Error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=51627&edit=1