No magic quotes requires stripslashes

For urgent and private issues, open a support ticket instead of posting: https://secure.installatron.com/tickets
jas8522
Posts: 57
Joined: Sat Jul 24, 2010 4:25 pm

No magic quotes requires stripslashes

Postby jas8522 » Tue Jul 05, 2011 6:40 am

A number of form input fields add slashes as appropriate for sanitizing before storing in the database. The problem is that upon retrieving that data from the database, the escape slashes remain. See the following email snippet that is sent out:
------
Hi there,
You\\\'ve got some new updates to install!
------

The same thing occurs when we save links with quotes in the branding SEO stamp config for installatron:

------
<a href=\\\"http://URL\\\" target=\\\"_blank\\\" title=\\\"US\\\">US</a>
------

The slashes are not only showing in the config, but they also appear on the sites they're stamped on, rendering the SEO useless.

As you can see by the number of escape slashes, it continually adds them upon each save of the config, making the number of slashes increase at an annoying rate.

Please fix this with some stripslashes() love!

Jordan

Phil
Staff
Posts: 486
Joined: Tue Jun 19, 2007 6:06 am

Re: No magic quotes requires stripslashes

Postby Phil » Tue Jul 05, 2011 6:48 am

Hello,

Please append these lines to /usr/local/installatron/etc/php.ini

Code: Select all

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off


These lines should be added automatically for most cases. If these lines exist and slashes still aren't behaving, open a ticket and we'll troubleshoot further.

Thank you,
Phil.
Phillip Stier
Installatron Co-Founder

jas8522
Posts: 57
Joined: Sat Jul 24, 2010 4:25 pm

Re: No magic quotes requires stripslashes

Postby jas8522 » Sun Jul 10, 2011 7:40 am

Phil,

This is a Plesk installed version of Installatron. The default plesk config for PHP is:

Code: Select all

magic_quotes_gpc = On
magic_quotes_runtime = Off


I had forgotten that it runs through the Plesk lighttpd install with v9 and thus uses a different php.ini than the rest of the system.

Are php.ini overrides possible with the Plesk custom lighttpd/php configuration? If so, is this the correct location for that file?

/usr/local/psa/admin/htdocs/modules/installatron/etc/php

I'd bet it's a bad idea to adjust the master config found at:

/usr/local/psa/admin/conf/php.ini

Since Plesk likely relies upon magic_quotes_gpc being enabled (otherwise I assume it wouldn't be on).

Thanks for your help.

Jordan

Phil
Staff
Posts: 486
Joined: Tue Jun 19, 2007 6:06 am

Re: No magic quotes requires stripslashes

Postby Phil » Sun Jul 10, 2011 11:43 am

Hello,

The correct location for Installatron PHP.INI changes is:

Code: Select all

/usr/local/installatron/etc/php.ini


The problem should be fixed after these lines are added to that file:

Code: Select all

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off


If any issues persist let us know.

Thank you,
Phil.
Phillip Stier
Installatron Co-Founder

jas8522
Posts: 57
Joined: Sat Jul 24, 2010 4:25 pm

Re: No magic quotes requires stripslashes

Postby jas8522 » Wed Jul 13, 2011 8:42 am

Those options were already set exactly as you have described on two of our servers that are experiencing this problem.

magic_quotes_gpc = Off
magic_quotes_runtime = Off
magic_quotes_sybase = Off


Those files have never been touched - I didn't even know they were there until now. Thus the default config appears accurate according to what you've described. Yet the problem still exists.

Phil
Staff
Posts: 486
Joined: Tue Jun 19, 2007 6:06 am

Re: No magic quotes requires stripslashes

Postby Phil » Wed Jul 13, 2011 6:45 pm

Hello,

That's strange. It's possible the global PHP configuration is overriding Installatron's PHP.INI.

Reply with the output of:

Code: Select all

/usr/local/installatron/bin/php -c /usr/local/installatron/etc/php.ini -i |grep quotes
/usr/local/installatron/bin/php -c /usr/local/installatron/etc/php.ini -i |grep ini


If it's preferred, reply with the output of those commands in a new ticket.

Thank you,
Phil.
Phillip Stier
Installatron Co-Founder


Return to “Administrative Technical Discussion and Troubleshooting”

Who is online

Users browsing this forum: No registered users and 1 guest