#29949 [Opn]: Relative include() sometimes works as expected
| From: | joaquim at telia dot com | Date: | Mon, 27 Sep 2004 09:53:23 +0000 |
| Subject: | #29949 [Opn]: Relative include() sometimes works as expected | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66754@lists.php.net to get a copy of this message | ||
ID: 29949
User updated by: joaquim at telia dot com
Reported By: joaquim at telia dot com
Status: Open
Bug Type: Scripting Engine problem
Operating System: WinXP
PHP Version: 4.3.8
New Comment:
I guess this is an obvious mistake, but in "Expected result", it's
supposed to say "spoon" instead of "foo".
Previous Comments:
------------------------------------------------------------------------
[2004-09-02 13:34:37] joaquim at telia dot com
Description:
------------
If include_path is set to ".", and the relative path in an include
statement contains "../" but doesn't start with "../", then the
relative path is relative to the including script instead of the
currently running script. This is inconsistent with the way in which
relative paths in include statements are supposed to work.
Reproduce code:
---------------
/a.php
<?
include "inc/module/b.php";
?>
/inc/module/b.php
<?
include "spoon/../../c.php"; // Note: There is no "spoon" catalog
?>
/inc/c.php
<?
echo "Hello world";
?>
Expected result:
----------------
"Warning: main(foo/../../c.php): failed to open stream: No such file or
directory in /inc/module/b.php on line 1"
The above result would be consistent with the error reported when
"foo/../" is removed from the code.
Actual result:
--------------
Outputs "Hello world" to the browser.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29949&edit=1