Re: [PHP] newbie - PHP escaping trigger happy

2008-09-02 Thread seungp
IIRC. That's covered under magic quotes . You should be able to turn that off 
via a config switch in php.ini or .htaccess.

  
-Original Message-
From: Govinda [EMAIL PROTECTED]

Date: Mon, 1 Sep 2008 20:21:10 
To: PHP-General Listphp-general@lists.php.net
Subject: [PHP] newbie - PHP escaping trigger happy

Just a quick Q, which I know has to be in the docs somewhere, but I  
haven't come across it yet-

PHP automatically escaping single and double quotes...  how to turn it  
off?

I.e.-
in a form text input, someone inputs
love's influence grows

and on the posted page I get:
love\'s \influence\

WHen I wrap that with  htmlspecialchars , then I get:
love\#039;s \quot;influence\quot; lt;growsgt;

What I want is:
love#039;s quot;influencequot;  lt;growsgt;

in this case anyway.  Probably if I understood why PHP was escaping  
the quotes, then I likely would want that behavior in those  
circumstances it was designed for...  but not now, and I don't know  
how to turn it off.

Thanks,
-Govinda

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie - PHP escaping trigger happy

2008-09-02 Thread Govinda

You guys got me on the right track, but:

On my Mac OS10.5.4/Apache2/webmin local (dev) setup (of which I know  
very little) I managed to find php.ini.default, make a copy while  
renaming to php.ini, open the copy (php.ini), and change that on  
to an off (the only one of the 3 that was on).  So now in that file,  
here is what I have:


; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off

; Magic quotes for runtime-generated data, e.g. data from SQL, from  
exec(), etc.

magic_quotes_runtime = Off

; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off

I go into webmin -- PHP and 'hand-edit' the PHP config file to  
convince myself that what I did should be recognized by Apache/PHP,  
and the textarea contents match.


So, WHY is php still escaping my quotes?

-Govinda

On Sep 2, 2008, at 10:36 AM, [EMAIL PROTECTED] wrote:
IIRC. That's covered under magic quotes . You should be able to turn  
that off via a config switch in php.ini or .htaccess.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie - PHP escaping trigger happy

2008-09-02 Thread Seung Park
1) did you restart the server to take advantage of the new settings?

2) are you sure you're running the php.ini at all?   (run phpinfo() from a
page to make sure that the server has read the right copy of php.ini)



On Tue, Sep 2, 2008 at 4:12 PM, Govinda [EMAIL PROTECTED] wrote:

 You guys got me on the right track, but:

 On my Mac OS10.5.4/Apache2/webmin local (dev) setup (of which I know very
 little) I managed to find php.ini.default, make a copy while renaming to
 php.ini, open the copy (php.ini), and change that on to an off (the
 only one of the 3 that was on).  So now in that file, here is what I have:

 ; Magic quotes for incoming GET/POST/Cookie data.
 magic_quotes_gpc = Off

 ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(),
 etc.
 magic_quotes_runtime = Off

 ; Use Sybase-style magic quotes (escape ' with '' instead of \').
 magic_quotes_sybase = Off

 I go into webmin -- PHP and 'hand-edit' the PHP config file to convince
 myself that what I did should be recognized by Apache/PHP, and the textarea
 contents match.

 So, WHY is php still escaping my quotes?

 -Govinda

 On Sep 2, 2008, at 10:36 AM, [EMAIL PROTECTED] wrote:

 IIRC. That's covered under magic quotes . You should be able to turn that
 off via a config switch in php.ini or .htaccess.


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] newbie - PHP escaping trigger happy

2008-09-02 Thread Govinda


On Sep 2, 2008, at 6:02 PM, Seung Park wrote:


1) did you restart the server to take advantage of the new settings?

no.  That was it.  Solved.  Sorry for what turned out to be OT.  When  
we're that green, we don't know OT from T.


2) are you sure you're running the php.ini at all?   (run phpinfo()  
from a

page to make sure that the server has read the right copy of php.ini)


Um.. no I wasn't.  Now I can check that all by myself too.  Thanks! ;-)

-G


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] newbie - PHP escaping trigger happy

2008-09-01 Thread Govinda
Just a quick Q, which I know has to be in the docs somewhere, but I  
haven't come across it yet-


PHP automatically escaping single and double quotes...  how to turn it  
off?


I.e.-
in a form text input, someone inputs
love's influence grows

and on the posted page I get:
love\'s \influence\

WHen I wrap that with  htmlspecialchars , then I get:
love\#039;s \quot;influence\quot; lt;growsgt;

What I want is:
love#039;s quot;influencequot;  lt;growsgt;

...in this case anyway.  Probably if I understood why PHP was escaping  
the quotes, then I likely would want that behavior in those  
circumstances it was designed for...  but not now, and I don't know  
how to turn it off.


Thanks,
-Govinda

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] newbie - PHP escaping trigger happy

2008-09-01 Thread Eric Butera
On Mon, Sep 1, 2008 at 10:21 PM, Govinda [EMAIL PROTECTED] wrote:
 Just a quick Q, which I know has to be in the docs somewhere, but I haven't
 come across it yet-

 PHP automatically escaping single and double quotes...  how to turn it off?

 I.e.-
 in a form text input, someone inputs
 love's influence grows

 and on the posted page I get:
 love\'s \influence\

 WHen I wrap that with  htmlspecialchars , then I get:
 love\#039;s \quot;influence\quot; lt;growsgt;

 What I want is:
 love#039;s quot;influencequot;  lt;growsgt;

 ...in this case anyway.  Probably if I understood why PHP was escaping the
 quotes, then I likely would want that behavior in those circumstances it was
 designed for...  but not now, and I don't know how to turn it off.

 Thanks,
 -Govinda

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



http://us.php.net/magicquotes

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php