PDA

View Full Version : weird behavior using single quot (bug?)


maltrecho
04-29-2005, 04:20 PM
working in a file upload script under windows & PHP 4.3.10 I found that if the name of the file has a single quot right before the dot before the extension (name'.gif) the $_FILES['my_file']['name'] returned is always only ".gif" or whatever extension it's got.

:confused:

marek_mar
04-29-2005, 04:27 PM
You shouldn't allow any quotes in the file names.

maltrecho
04-29-2005, 04:50 PM
You shouldn't allow any quotes in the file names.
How can I allow or disallow single quotes if the file name is automatically being cut by php?

(Also tested with php 4.3.11)

Velox Letum
04-29-2005, 05:46 PM
str_replace() (http://www.php.net/function.str-replace)