Re: QF/DataObject mangling input chars

From: Date: Fri, 20 May 2005 05:02:52 +0000
Subject: Re: QF/DataObject mangling input chars
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-19292@lists.php.net to get a copy of this message
On 5/18/05, Ken Restivo <ken@restivo.org> wrote: > I'm really confused by a strange bit of behaviour from QF when used with DataObject. > > I'm trying to save a text field that has formatting in it: mostly carriage returns and > tabs and quotations and some html special chars. > > As far as I can tell, the \n\r's are passed as actual NL/CR characters in the $vars > argument to the QuickForm::process() method. But, then when I actually assign the vars to the > DataObject, somehow the NL/CR get turned into actual literal '\', 'n', > '\', 'r' characters: 4 chars instead of 2. I have no idea why DataObject is > doing that, but it's making me crazy. The stuff then gets saved to the database that way: > utterly useless. > > Somewhere, probably inside DataObject, some magic is happening, and it's Bad magic. > What's going on here? > Ummm....no, DataObject does not normally do this. I'm using DB_DataObject (with FormBuilder) to enter all sorts of data, often including newlines. You should probably check your magic_quotes settings. What DB are you using? Perhaps DB's quoting method is incorrect for the DB you're using? -- Justin Patrin

« previous php.pear.general (#19292) next »