|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51627 script path not correctly evaluated
Submitted: 2010-04-21 23:28 UTC Modified: 2010-04-22 00:22 UTC
From: russell dot tempero at rightnow dot com Assigned: felipe (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: russell dot tempero at rightnow dot com
New email:
PHP Version: OS:


 [2010-04-21 23:28 UTC] russell dot tempero at rightnow dot com
Using PHP as CGI (not FastCGI).

Pertinent php.ini values:

Path to file:

When I hit the following URL, I get a "file not found" error:

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


fopen_wrappers.c.diff (last revision 2010-04-21 21:29 UTC by russell dot tempero at rightnow dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-22 00:22 UTC]
Automatic comment from SVN on behalf of felipe
Log: - Fixed bug #51627 (script path not correctly evaluated)
  Patch by: russell dot tempero at rightnow dot com
 [2010-04-22 00:22 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-04-22 00:22 UTC]
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
Thank you for the report, and for helping us make PHP better.

Thanks for the patch!
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Mar 26 06:03:39 2023 UTC