|
Posted by Mark Goodge on 05/14/07 19:07
On Mon, 14 May 2007 00:25:58 +0200, Alfred Molon put finger to
keyboard and typed:
>In article <1179093340.453709.241100@n59g2000hsh.googlegroups.com>,
>matt.farey@gmail.com says...
>
>> alfred, i use php uploads with single quotes just fine, it copes with
>> a large range of characters including single quotes.
>> you say "the uploads dont work properly" but I am unclear as to what
>> that means, where does the process fail? I just think it's a coding/
>> config issue, the actual upload functionality will remain completely
>> unaffected - if your system is set up properly.
>
>It's a shared host and I can not set the system.
>
>In any case what happens, is that the image will upload and be stored in
>the temporary , but then the PHP code will mess up the filename.
>
>For instance, if I upload the file "Al Azhar's mosque Cairo.jpg" (with
>the apostrophe), the PHP code will automatically convert the filename to
>"Al Azhar\'s mosque Cairo.jpg" (i.e. insert a backslash) and store a
>file named "Al Azhar\'s mosque Cairo.jpg" in the temporary directory.
You've got magic_quotes_gpc switched on, but the script assumes you
haven't. That's one of the gotchas I was referring to in a different
thread!
There are two solutions to that. The easiest, if you can do it, is to
switch it off either sitewide (using .htaccess) or in the upload
script (using php_ini_set()). If you can't, then you need to pass the
variables through stripslashes() before processing them with your file
handling routine.
Mark
--
Please give me one! http://www.pleasegivemeone.com
"L'amore giunger, l'amore"
Navigation:
[Reply to this message]
|