Roundcube Community Forum

 

magic_quotes_gpc

Started by ishvir, March 25, 2008, 09:19:54 AM

Previous topic - Next topic

ishvir

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

jarred89

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

dj2

As long as your host allows to the .htaccess file, open it and add this line:
php_flag magic_quotes_gpc offSave, and you should be set.

jarred89

Where is the .htaccess file?

dj2

It's located in the root directory when you login via FTP.  You may have to set your FTP app to show invisible files.

jarred89

The one in the public_html folder?

dj2

Quote from: jarred89;13370The one in the public_html folder?

That's the one :)

jarred89

Cool, There is nothing in it so ill just copy that to it and save it then upload it again.

jarred89

Quote from: jarred89;13372Cool, 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...

dano

You want to put it in the .htaccess that is in your Roundcube root which should already have quite a few lines in it.

dj2

Quote from: dano;13376You 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.

jarred89

and copying it into the root directory in round cube does'nt work either....

jak119

Quote from: dano;13376You 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.

yourregistrationisbroken

Quote from: jak119;13379Is 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);

dano

Quote from: jak119;13379Is 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...