Hi there, one of my clients has a CMS that was hosted on a php4.3 server
They fired their web developers, hired me, and moved to a new hosting environment that is php5 (I have no control over where they choose to host)
The original developers used magic quotes... Ugg
When the site was moved, I turned magic quotes on because of the HUGE volume of database inserts, updates and reads that were not coded with add/strip slashes.
Now, whenever they update any content, extra single quotes are being added everywhere.
I know the best thing to do is clean up the code with addslashes and stipslashes everywhere, but my client doesn't have the funding for that major of a re-write. (Literally thousands of occurrences need to be updated)
Does anyone have a less time-consuming workaround for this issue?
Thanks!
PHP 4 to 5 Magic Quote Fix?
Moderator: General Moderators
-
mistymorningglory
- Forum Newbie
- Posts: 5
- Joined: Fri Sep 26, 2008 4:27 pm
Re: PHP 4 to 5 Magic Quote Fix?
Did you look at this
http://us.php.net/magic_quotes
http://us.php.net/magic_quotes
Re: PHP 4 to 5 Magic Quote Fix?
Ok, I don't get...didn't they have those extra single quotes (I think you mean slashes?) before as well. From what you wrote I understand you turned magic quotes on as was all before. If all acts like before...seems manager likes it that way.
-
mistymorningglory
- Forum Newbie
- Posts: 5
- Joined: Fri Sep 26, 2008 4:27 pm
Re: PHP 4 to 5 Magic Quote Fix?
Yes, I've read all about magic quotes. The original codebase was poorly written and relys completely on it, so I turned it on in the new hosting environment (php5). Now when they update their content, extra single quotes are getting added.
For example, in a text field a customer enters their last name as "O'Malley".
Then if they do anything else where they update their profile, another single quote gets added, i.e. "O''Malley", then the next time they update, another one appears "O'''Malley", and so on...
It doesn't do this in PHP4.3 and I haven't been able to find any other posts where people are experiencing the same issue.
For example, in a text field a customer enters their last name as "O'Malley".
Then if they do anything else where they update their profile, another single quote gets added, i.e. "O''Malley", then the next time they update, another one appears "O'''Malley", and so on...
It doesn't do this in PHP4.3 and I haven't been able to find any other posts where people are experiencing the same issue.
Re: PHP 4 to 5 Magic Quote Fix?
Well I don't think this is addslashes magic quotes issue. If it is..it should add '\' escape char not quotes.
-
mistymorningglory
- Forum Newbie
- Posts: 5
- Joined: Fri Sep 26, 2008 4:27 pm
Re: PHP 4 to 5 Magic Quote Fix?
At one point I was thinking the same thing, but I couldn't figure out what else it would be.
Any ideas? It is certainally related to a difference between php4 & 5... Does php5 has something wokny about single quotes I haven't heard about?
Any ideas? It is certainally related to a difference between php4 & 5... Does php5 has something wokny about single quotes I haven't heard about?
Re: PHP 4 to 5 Magic Quote Fix?
no clue. haven't heard of such thingy. I suggest you debug it and see what exactly cause it. If you figure it out for one case, should be same for rest.