Page 1 of 1

Removing the backslashes when uploading?

Posted: Mon Mar 19, 2007 10:31 am
by Dale
When items get uploaded to one of my sites, if they have a single quote ' in it, the file always gets renamed to \'. (Eg; dale'ssong.mp3 when uploaded ends up as dales\'ssong.mp3) is there a way to stop this?

Posted: Mon Mar 19, 2007 10:34 am
by Chris Corbyn
If you have the power to do so, turn off magic_quotes_gpc and the other magic quotes settings in php.ini. If not, use stripslashes(). For portablitity to other servers you may want to check if magic quotes is turned on by using the get_magic_quotes_gpc() function ;)

Posted: Mon Mar 19, 2007 10:40 am
by Dale
Ahh stripslashes() ... why didn't I think of that. :p

Cheers buddy. :)