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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kir at astrive dot ru
New email:
PHP Version: OS:

 

 [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 Oct 06 15:05:53 2022 UTC