Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4324 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 16652 invoked by uid 1010); 31 Aug 2003 16:10:11 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 16628 invoked from network); 31 Aug 2003 16:10:11 -0000 Received: from unknown (HELO mail.rocketservers.net) (64.246.52.103) by pb1.pair.com with SMTP; 31 Aug 2003 16:10:11 -0000 Received: (qmail 29864 invoked from network); 31 Aug 2003 16:11:41 -0000 Received: from unknown (HELO localhost) (127.0.0.1) by localhost with SMTP; 31 Aug 2003 16:11:41 -0000 To: internals@lists.php.net In-Reply-To: <20030831151149.GC16462@bagend.shire> References: <1062302408.2724.33.camel@localhost> <20030831151149.GC16462@bagend.shire> Content-Type: text/plain Message-ID: <1062346210.552.17.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.0 Date: 31 Aug 2003 11:10:10 -0500 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Looking for comments whether this is a bug or not From: jsjohnst@altdns.net (Jeremy Johnstone) On Sun, 2003-08-31 at 10:11, Curt Zirzow wrote: > * Thus wrote Jeremy Johnstone (jsjohnst@altdns.net): > > > > $email->body = "This is a test email. Testing c:\test\foo.exe"; > > > > When the $email object is later broke down and stored in the database > > addslashes is done (as it should be) before the variable is stored. > > > > If you check the database though, no slashes were added to the string. > > addslashes() is working properly. What you're experiencing is > the database servers' translation of '\\' -> '\'. > > The documentation on addslashes explains this: > http://php.net/addslashes You might want to check the documentation again as it does not say anything about the db server translating \\ into \. This seems highly illogical, because if thats the case then addslashes("This is Jeremy's test of c:\test\foo.exe") would get corrupted when you strippedslashes after you pulled it back out of the database. If this is the case, which database servers translate this way? I will then make sure I go update the documentation accordingly. > > > > I am doing something wrong (or did I misunderstand something) or is this > > in fact a bug? I have tested it on PHP 4.2, 4.3.2, and 4.3.3 and the > > btw, you should post these questions to the php-general list, > especially when you are in doubt if you're using the function > properly. > Actually I was quite sure I was using the function correctly, I said that in case I misunderstood something in the documentation and thus needed to update the documentation accordingly.