ooo! This is something that was causing problems on my install, too. Was trying to identify all the characters that cause problems in this thread http://forum.linuxmce.org/index.php?topic=6484.0
Do you think that your change will cover all special characters or just the single quote issue (I note that I manually went through and removed all my single quotes from file names)
addslashes() only handles quoting...
Returns a string with backslashes before characters that need to be quoted in database queries etc. These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).
From previous experience, I've found you can run into all sorts of troubles with filenames that contain weird characters. On forms I usually rename uploaded files that contain
a space, %20, +, ', #, %, [ and ]
The biggest problem is users can dump anything they want into the LMCE Media directories.
To "fix" them you'd need to run some kind of script to filter out the bad characters and rename files but by then it may be too late anyway.