Bug #15200 Updated: file() function sometimes adds slashes before single and double quotes
ID: 15200
Updated by: ceo@l-i-e.com
-Reported By: phasme@cicv.fr
+Reported By: ceo@l-i-e.com
Status: Feedback
Bug Type: Filesystem function related
Operating System: Linux 2.4 Mandrake 8
PHP Version: 4.0.6
New Comment:
Things *I* would be looking for...
Multiple php.ini files on the server that are somehow being
accessed.
.htaccess files that are setting MagicQuotes differently
depending on what path (especially if symlinks are
involved) is used to reach the page.
Anything unusual about the server configuration in
httpd.conf, php.ini, .htaccess, PHP features compiled in
etc.
Previous Comments:
------------------------------------------------------------------------
[2002-01-25 04:45:49] phasme@cicv.fr
This behaviour doesn't seem to occur with fopen() and readfile()
functions...
------------------------------------------------------------------------
[2002-01-24 11:05:02] sander@php.net
OK. Reopening.
Please upgrade to the latest version.
Does the same behaviour occur with fopen() or readfile() or other
file-functions?
------------------------------------------------------------------------
[2002-01-24 08:53:16] phasme@cicv.fr
My scripts remain unchanged, but the results are random... sometimes it
works and sometimes it doesn't.
Where *constant* inputs produce *variable* outputs through a *constant*
process within a *constant* configuration, can't we speak about bug ?
We have another server with the same version of PHP, the same 'php.ini'
file and the same modules and extensions, which works and runs the same
scripts without any problem...
For me, it's not a problem with magic quotes configuration.
------------------------------------------------------------------------
[2002-01-24 07:25:26] sander@php.net
RTM on magic quotes!
------------------------------------------------------------------------
[2002-01-24 06:01:05] phasme@cicv.fr
this bug (?) is difficult to encircle and reproduce (and understand),
because it appears in a very erratic way.
from time to time, when a file is read with file() and its content
displayed line by line with each(), all its single and double quotes
are automatically backslashed !
example :
with 'toto.txt' contains : je n'aime pas ce "bug" !
and the following script :
<?php
$my_file = file('toto.txt');
while(list(, $my_line) = each($my_file)) {
echo $my_line;
}
?>
**sometimes** we get something like :
je n\'aime pas ce \"bug\" !
(and sometimes not...)
?!?!
- our system :
Linux 2.4 (Mdk 8)
Apache 1.3.22
PHP 4.0.6 (RPM Mdk)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=15200&edit=1
Thread (6 messages)