Magic Quotes GPC On - how to change?

Need help installing Joomla! 3.x? For all Joomla! 3.x installation issues please use this forum.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
schartier
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Jun 09, 2011 1:55 am

Magic Quotes GPC On - how to change?

Post by schartier » Thu Oct 04, 2012 1:57 pm

I tried everything to fix the double quotes (") being escaped (\") .

I tried disabling magic_qotes any way possible but this did not worked! The only solution I found was editing library/joomla/input/filter/input.php.

Function clean (line 159)

Code: Select all

public function clean($source, $type = 'string') {

        // Handle the type constraint
        switch (strtoupper($type)) {
            case 'INT':
as follow:

Code: Select all

public function clean($source, $type = 'string') {

        if(get_magic_quotes_gpc()){
            if (is_string($source))
                $source = stripslashes($source);
            else if(is_array($source))
                array_walk($source, create_function ('&$var', '$var=stripslashes($var);'));
        }

        // Handle the type constraint
        switch (strtoupper($type)) {
            case 'INT':

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: Magic Quotes GPC On - how to change?

Post by humvee » Fri Oct 05, 2012 7:31 am

[Mod Note: Split this topic into a separate thread. Please do not hijack someone else's thread! Please see forum rules for details on how to post to these forums]

Why are you editing core files in Joomla to correct a problem with your server configuration?

The solution to the issue is to ensure magic_quotes is disabled in the php.ini configuration file.

If you do not have control over this, speak to your host, if they won't do anything about it find yourself a host that knows what they are doing and move.

Never edit the core files of Joomla unless so directed by the Joomla developers by way of a temporary bug fix prior to an update release.

User avatar
mikekist
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Jul 05, 2007 4:16 pm

Re: Magic Quotes GPC On - how to change?

Post by mikekist » Mon Oct 22, 2012 8:23 am

I was having problems with escaped characters and was just about ready to give up. I had placed a php.ini file in the joomla root directory as well as a phpinfo.php file to verify the settings. The phpinfo file was indeed returning magic_quotes_gpc as off yet I was still having problems with escaped characters when saving an article with html including css code.

Then I read humvee's post on another thread stating that you must place the php.ini file in the administrator directory as well. Once accomplished the problem disappeared and I was able to save the articles with css formatting without error.

Thanks humvee for saving me additional hours of troubleshooting - I should have come here first.

User avatar
humvee
Joomla! Master
Joomla! Master
Posts: 14704
Joined: Wed Aug 17, 2005 10:27 pm
Location: Kent, England

Re: Magic Quotes GPC On - how to change?

Post by humvee » Tue Oct 23, 2012 8:19 am

Shows the value of a quick search of the forum or reading the documentation, glad it helped mikekist.


Locked

Return to “Installation Joomla! 3.x”