Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:395 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22003 invoked from network); 27 Mar 2003 20:34:24 -0000 Received: from unknown (HELO mxout1.netvision.net.il) (194.90.9.20) by pb1.pair.com with SMTP; 27 Mar 2003 20:34:24 -0000 Received: from moshe ([212.179.181.81]) by mxout1.netvision.net.il (iPlanet Messaging Server 5.2 HotFix 1.08 (built Dec 6 2002)) with ESMTPA id <0HCF005MFD5B98@mxout1.netvision.net.il> for internals@lists.php.net; Thu, 27 Mar 2003 22:34:23 +0200 (IST) Date: Thu, 27 Mar 2003 22:37:13 +0200 To: internals@lists.php.net Message-ID: <025501c2f4a0$a6448bd0$b301000a@moshe> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Mailer: Microsoft Outlook Express 6.00.2800.1106 Content-type: text/plain; charset=windows-1255 Content-transfer-encoding: 7BIT X-Priority: 3 X-MSMail-priority: Normal Subject: Fw: #22904 [Opn]: fwrite is not binary safe for '\0' string From: mosdoron@netvision.net.il (moshe doron) i want did the suggested patch there are rejections? ----- Original Message ----- From: Newsgroups: php.bugs To: Sent: Thursday, March 27, 2003 11:06 AM Subject: #22904 [Opn]: fwrite is not binary safe for '\0' string > ID: 22904 > Updated by: momo@php.net > Reported By: momo@php.net > Status: Open > Bug Type: Filesystem function related > Operating System: linux RH7.2 > PHP Version: 4.3.2RC1 > New Comment: > > ok, problem here is that php_stripslashes for sybase_magic_quetes > replace '\0' with ascii(0) due reverse action on php_addslashes. > > IMHO in contrary to '\'' type replacements where we "maintains" the > data "queues fixed" all over the script, on ascii(0) data, we have no > problem do it onto the query level. > there'll be minore bc problem but the current beavior is totally bogus! > > > Previous Comments: > ------------------------------------------------------------------------ > > [2003-03-26 10:31:27] momo@php.net > > well, using set_magic_quotes_runtime(0); fix the problem. > > due to my quick debug, the problem is somewhere into php_stripslashes > called on file.c:1543 i'll try to look into it on friday if this bug > still 'll be exists. > > ------------------------------------------------------------------------ > > [2003-03-26 10:18:30] momo@php.net > > problem still exists on last cvs. > > my editor show ascii(0) as ? but '\0' have to be showen as '\0' > mean, if the orginal text (c code this case) file included the \0 > *string* i does't want fwrite() replace it with ascii(0)! but to save > it as the orginal string. > > ------------------------------------------------------------------------ > > [2003-03-26 09:33:33] iliaa@php.net > > Please try using this CVS snapshot: > > http://snaps.php.net/php4-STABLE-latest.tar.gz > > For Windows: > > http://snaps.php.net/win32/php4-win32-STABLE-latest.zip > > Cannot verify this bug with latest CVS. I think your editor just shows > \0 as ? > > ------------------------------------------------------------------------ > > [2003-03-26 09:25:48] momo@php.net > > here is simple code: > ---------------- > $f = fopen("test.txt","rb"); > $buf= fread($f,4096); > $f2 = fopen("test2","wb"); > fwrite($f2,$buf); > ?> > --------------- > > where test.txt content is: > --------------test \0 test > -------------- > > the result test2 file is: > --------------- > test ? test > --------------- > > ------------------------------------------------------------------------ > > > -- > Edit this bug report at http://bugs.php.net/?id=22904&edit=1 >