Author Topic: magic_quotes_gpc  (Read 17524 times)

Offline ishvir

  • Newbie
  • *
  • Posts: 5
magic_quotes_gpc
« on: March 25, 2008, 09:19:54 AM »
Hi!

I am running RoundCube Webmail Installer

Under the, Checking php.ini/.htaccess settings, I get the error:
magic_quotes_gpc: NOT OK(is '1', should be '0')

Is it ok for me to have inserted:

php_flag magic_quotes_gpc off

into .htaccess as displayed below:

# AddDefaultCharset  UTF-8
AddType text/x-component .htc


 php_flag  display_errors  Off
 php_flag  log_errors  On
 php_flag  magic_quotes_gpc off
 php_value  error_log  logs/errors
 php_value  upload_max_filesize  5M
 php_value  post_max_size  6M
 php_value  memory_limit  64M
 php_value  session.auto_start  0
 php_value  zlib.output_compression  0
 php_value  magic_quotes_gpc  0



 php_flag  display_errors  Off
 php_flag  log_errors  On
 php_flag  magic_quotes_gpc off
 php_value  error_log  logs/errors
 php_value  upload_max_filesize  5M
 php_value  post_max_size  6M
 php_value  memory_limit  64M
 php_value  session.auto_start  0
 php_value  zlib.output_compression  0
 php_value  magic_quotes_gpc  0



 Order allow,deny
 Deny from all


Order deny,allow
Allow from all

Offline jarred89

  • Jr. Member
  • **
  • Posts: 11
magic_quotes_gpc
« Reply #1 on: August 19, 2008, 07:36:50 AM »
This error has come up for me as well, But I don't know how to fix it.. Is someone able to tell me?

Thanks,
Jarred

Offline dj2

  • Jr. Member
  • **
  • Posts: 40
magic_quotes_gpc
« Reply #2 on: August 19, 2008, 10:51:58 AM »
As long as your host allows to the .htaccess file, open it and add this line:
Code: [Select]
php_flag magic_quotes_gpc offSave, and you should be set.

Offline jarred89

  • Jr. Member
  • **
  • Posts: 11
magic_quotes_gpc
« Reply #3 on: August 19, 2008, 10:57:52 AM »
Where is the .htaccess file?

Offline dj2

  • Jr. Member
  • **
  • Posts: 40
magic_quotes_gpc
« Reply #4 on: August 19, 2008, 11:02:50 AM »
It's located in the root directory when you login via FTP.  You may have to set your FTP app to show invisible files.

Offline jarred89

  • Jr. Member
  • **
  • Posts: 11
magic_quotes_gpc
« Reply #5 on: August 19, 2008, 11:10:06 AM »
The one in the public_html folder?

Offline dj2

  • Jr. Member
  • **
  • Posts: 40
magic_quotes_gpc
« Reply #6 on: August 19, 2008, 11:35:48 AM »
Quote from: jarred89;13370
The one in the public_html folder?


That's the one :)

Offline jarred89

  • Jr. Member
  • **
  • Posts: 11
magic_quotes_gpc
« Reply #7 on: August 19, 2008, 11:39:24 AM »
Cool, There is nothing in it so ill just copy that to it and save it then upload it again.

Offline jarred89

  • Jr. Member
  • **
  • Posts: 11
magic_quotes_gpc
« Reply #8 on: August 19, 2008, 11:43:22 AM »
Quote from: jarred89;13372
Cool, There is nothing in it so ill just copy that to it and save it then upload it again.


It makes the whole site not work...

Offline dano

  • Full Member
  • ***
  • Posts: 124
magic_quotes_gpc
« Reply #9 on: August 19, 2008, 12:07:59 PM »
You want to put it in the .htaccess that is in your Roundcube root which should already have quite a few lines in it.

Offline dj2

  • Jr. Member
  • **
  • Posts: 40
magic_quotes_gpc
« Reply #10 on: August 19, 2008, 12:35:10 PM »
Quote from: dano;13376
You want to put it in the .htaccess that is in your Roundcube root which should already have quite a few lines in it.


That's weird, I used the .htaccess file in my own /public_html/ directory and it worked fine.

Offline jarred89

  • Jr. Member
  • **
  • Posts: 11
magic_quotes_gpc
« Reply #11 on: August 19, 2008, 01:22:07 PM »
and copying it into the root directory in round cube does'nt work either....

Offline jak119

  • Newbie
  • *
  • Posts: 2
magic_quotes_gpc
« Reply #12 on: August 19, 2008, 01:42:51 PM »
Quote from: dano;13376
You want to put it in the .htaccess that is in your Roundcube root which should already have quite a few lines in it.


Is there a work around without using .htaccess since I'm on windows, IIS, and Plesk? My php.ini file system wide however does have magic quotes turned off.

Offline yourregistrationisbroken

  • Jr. Member
  • **
  • Posts: 10
magic_quotes_gpc
« Reply #13 on: August 19, 2008, 08:12:29 PM »
Quote from: jak119;13379
Is there a work around without using .htaccess since I'm on windows, IIS, and Plesk? My php.ini file system wide however does have magic quotes turned off.


Add this to the top of index.php


if (get_magic_quotes_gpc() ) {
    
$stripquotes create_function('&$data, $self',
          
'if (is_array($data)) foreach ($data as $k=>$v) $self($data[$k], $self); '.
          
'else $data = stripslashes($data);');
    
$stripquotes($_POST,$stripquotes);
    
$stripquotes($_GET,$stripquotes);
    
$stripquotes($_COOKIE,$stripquotes);
}


Then change value of magic_quotes_gpc to 1 in the installer/check.php


$ini_checks 
= array('file_uploads' => 1'session.auto_start' => 0,
    
'magic_quotes_gpc' => 1'magic_quotes_sybase' => 0);


Then remove the strip_slashes command from program/include/main.inc (line 503)



  
// strip slashes if magic_quotes enabled
//  if ((bool)get_magic_quotes_gpc())
//    $value = stripslashes($value);

Offline dano

  • Full Member
  • ***
  • Posts: 124
magic_quotes_gpc
« Reply #14 on: August 20, 2008, 01:08:31 PM »
Quote from: jak119;13379
Is there a work around without using .htaccess since I'm on windows, IIS, and Plesk? My php.ini file system wide however does have magic quotes turned off.

Looks like there is an option for you to try now.

You being on Windows and using IIS could be the problem since IIS does not use .htaccess files...