php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19526 can't turn magic quotes off
Submitted: 2002-09-20 09:41 UTC Modified: 2002-09-20 11:41 UTC
From: jayv at nortelnetworks dot com Assigned:
Status: Not a bug Package: PHP options/info functions
PHP Version: 4.2.2 OS: Win2K
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: jayv at nortelnetworks dot com
New email:
PHP Version: OS:

 

 [2002-09-20 09:41 UTC] jayv at nortelnetworks dot com
Try this page on a server with magic_quotes_gpc on at the master level.  It seems to turn off magic quotes at the local level (the page) yet it still adds the backslash before my single quote.

<?php

// import variables into 'p_' space
import_request_variables('gp', 'p_');

$succ = ini_set("magic_quotes_gpc","0");
if ($succ){print "Magic Quotes was set successfully<br>";}

$succ = ini_set("magic_quotes_runtime","0");
if ($succ){print "Magic Quotes Runtime was set successfully<br>";}

$var = get_magic_quotes_gpc();
print "Magic Quotes = ". $var . "<br>";

if(!isset($p_name)||$p_name==''){$p_name="O'Conner";}

?>

<form name=myForm action=test.php method=post>

<input type="text" name="name" value="<?php echo $p_name; ?>">

<input type=submit value="submit">
<p>
Keep hitting submit

</form>

<?php
print phpinfo();
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-09-20 11:20 UTC] sander@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php

Thank you for your interest in PHP.


 [2002-09-20 11:23 UTC] jayv at nortelnetworks dot com
How do you figure?  If a function call ini_set(magic_quotes_gpc,0) doesn't do what it is supposed to (which is turn of magic_quotes), why is that not a bug??  Are you telling me it was design intent to have a function that does nothing?
 [2002-09-20 11:41 UTC] sander@php.net
Changing the value of magic_quotes_gpc is only effective if it's set _before_ the script starts (e.g. via php.ini, httpd.conf or .htaccess). In the CVS version you should get a warning if you try to set it in a script anyway.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 16:01:31 2024 UTC