php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2229 Unable to restore magic_quotes_gpc
Submitted: 1999-09-03 04:53 UTC Modified: 1999-09-03 11:06 UTC
From: kir at astrive dot ru Assigned:
Status: Closed Package: Other
PHP Version: 3.0 Latest CVS (03/09/1999) OS: Solaris 2.7 x86
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
15 + 32 = ?
Subscribe to this entry?

 
 [1999-09-03 04:53 UTC] kir at astrive dot ru
I'm not quite sure if it is a bug or a feature. If it is the feature, I suppose it to be a documentation problem.
In a short, in my configuration I'm unable to switch on magic_quotes_gpc.

[php3.ini]
magic_quotes_gpc        =       On 

httpd.conf:
Group astrive
<Directory /u/home/kir/public_html>
AllowOverride All
</Directory>

$ ls -la  /ASTRIVE/
drwxr-xr-x   5 kir      staff        512 Sep  3 12:13 .
drwxr-x--x  19 kir      astrive     2048 Sep  2 17:12 ..
-rw-r--r--   1 kir      staff         25 Sep  3 12:12 .htaccess
-rw-r--r--   1 kir      staff         34 Sep  3 12:34 a.php3

$ cat /u/home/kir/public_html/.htaccess
magic_quotes_gpc off
$cat /u/home/kir/public_html/ASTRIVE/.htaccess
magic_quotes_gpc on
^^^^^^^^^^^^^^^^^^^^^
 This directive doesn't work !!! So I'm unable to switch on magic quotes
in this sutuation. 
In merging function in mod_php3.c there are lines:

php3_ini_structure *base = (php3_ini_structure *) basev;
php3_ini_structure *add = (php3_ini_structure *) addv;
php3_ini_structure orig = php3_ini_master;

/* base structure is used !*/
memcpy(new,base,sizeof(php3_ini_structure));
/* compare with php3.ini structure !! Why ? */
if (add->magic_quotes_gpc != orig.magic_quotes_gpc) 	
	new->magic_quotes_gpc = add->magic_quotes_gpc;

So as I understand In my situation if I switch magic quotes off in some directory, I will unable to switch it back in subdirectory, if my php3.ini
have magic quotes on by default. 

The same problem corresponds to the most of other directives in php3.ini.
Or it is not a problem ?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-09-03 11:06 UTC] rasmus at cvs dot php dot net
As per the docs, when used in an Apache .conf or .htaccess file, the PHP directives all start with _php3
So you want:

php3_magic_quotes_gpc On
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 08 17:05:52 2022 UTC