Re: preg_match() and MIME type detection fails

See all posts Reply

Re: preg_match() and MIME type detection fails new!
by Pablo, 9 years, 6 months ago
I put the class in a server with PHP 5.4

I have the following error
Warning: preg_match(): Compilation failed: invalid range in character class at offset 7 in /home/shiramod/public_html/admin/classes/class.upload032.php on line 3011

I set up to only accept "image/*" but I can upload others extensions too.

Can you help me, please.

Thanks a lot!!

This is the log:

system information
- class version : 0.32
- operating system : Linux
- PHP version : 5.4.31
- GD version : 2.1.0
- supported image types : png jpg gif bmp
- open_basedir : /home/shiramod:/usr/lib/php:/usr/local/lib/php:/tmp
- upload_max_filesize : 10M (10485760 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
Fileinfo PECL extension not available
- Checking MIME type with UNIX file() command
PHP exec() function is disabled
- Checking MIME type with mime.magic file (mime_content_type())
mime_content_type() is not available
- Checking MIME type with getimagesize()
getimagesize() failed
- MIME type detected as text/plain by browser
- Try to guess MIME type from file extension (txt): MIME type set to text/plain
source variables
- You can use all these before calling process()
file_src_name : keywords.txt
file_src_name_body : keywords
file_src_name_ext : txt
file_src_pathname : /tmp/php0B0dPk
file_src_mime : text/plain
file_src_size : 1449 (max= 10485760)
file_src_error : 0
process file to ../img/productos/thumb/
- file size OK
- error: Incorrect type of file.
process file to ../img/productos/normal/
- file size OK
- file mime OK : text/plain
- file name safe format
- destination variables
file_dst_path : ../img/productos/normal/
file_dst_name_body : keywords
file_dst_name_ext : txt
- checking for auto_rename
- destination file details
file_dst_name : keywords.txt
file_dst_pathname : ../img/productos/normal/keywords.txt
- keywords.txt doesn't exist already
- no image processing wanted
- process OK
process file to ../img/productos/large/
- file size OK
- file mime OK : text/plain
- file name safe format
- destination variables
file_dst_path : ../img/productos/large/
file_dst_name_body : keywords
file_dst_name_ext : txt
- checking for auto_rename
- destination file details
file_dst_name : keywords.txt
file_dst_pathname : ../img/productos/large/keywords.txt
- keywords.txt doesn't exist already
- no image processing wanted
- process OK
process file to ../img/productos/listado/
- file size OK
- file mime OK : text/plain
- file name safe format
- destination variables
file_dst_path : ../img/productos/listado/
file_dst_name_body : keywords
file_dst_name_ext : txt
- checking for auto_rename
- destination file details
file_dst_name : keywords.txt
file_dst_pathname : ../img/productos/listado/keywords.txt
- keywords.txt doesn't exist already
- no image processing wanted
- process OK
cleanup
- delete temp file /tmp/php0B0dPk
Reply
Re: preg_match() and MIME type detection fails new!
by colin, 9 years, 6 months ago
It will be fixed in the next release, that you can actually test here.Reply