#23956 [Bgs]: fopen cannot write in include-path
| From: | markus at scherner dot de | Date: | Mon, 02 Jun 2003 17:54:54 +0000 |
| Subject: | #23956 [Bgs]: fopen cannot write in include-path | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40928@lists.php.net to get a copy of this message | ||
ID: 23956
User updated by: markus at scherner dot de
Reported By: markus at scherner dot de
Status: Bogus
Bug Type: Filesystem function related
Operating System: win nt, win xp, unix
PHP Version: 4.3.2
New Comment:
I know this very well and I use the function in this example only for
own testings which are not official assignable. When it is so risky
that way you mean, why is the parameter [in include path] supported for
this function? And more, why does it work in 4.3.0 and not in 4.3.2 ?
Previous Comments:
------------------------------------------------------------------------
[2003-06-02 09:33:05] wez@php.net
writing to a file in the include path will give undefined results and
is a potential security risk.
As such we do not support it, and you might find that attempting to use
fopen() in this way will raise a warning in PHP 5.
------------------------------------------------------------------------
[2003-06-02 08:19:51] markus at scherner dot de
Hey everybody.
Today updated php on my local system (win nt) from 4.3.0 to 4.3.2. Now
the function fopen() gives me an error, when I will write a file within
the include path. In the version before, this error does not exist.
I am using following syntax:
$fp =
fopen($maildir.$localmaildir.microstamp().'_'.$email.'.txt',"w",1);
remark for you:
the include-path is set before to a path outside the htdocs-dir. The
command fopen (see above) is called from a function which is included
within the script, the var $maildir.$localmaildir is a dir within the
includedir and all works fine until the update, so it must be a bug (or
it was a bug before and I lived with the bug as well :-) ).
The error output is:
fopen(mail/localmail/105455483215927000_test@test.de.txt): failed to
open stream: No such file or directory in c:\www\casyincs\functions.php
on line 1182
The pathes are:
www\casyincs (include dir)
www\casyincs\functions.php (includefile with the command)
www\casyincs\mail\localmail (in this dir have to be saved the file
www\htdocs\index.php (web-directory with executing script)
Hoping for an answer,
best regards and thankyou for a wonderfull powerfull programming
language!!!
best regards
Markus
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23956&edit=1