i am using multi file upload hacked for specific filenames (image and thumb) from array in cfg. i noticed some files with names like "thumb .web.jpg" that i wanted to be "thumb.jpg". looking in code i found
###### hack for array filenames
$filename = $newfile[int($Number)] . substr($filename,index($filename,"."));
######
if i understand this correctly, index finds the FIRST occurence of "." and uses all original filename from that point on. i changed code to:
###### hack for array filenames
$filename = $newfile[int($Number)] . substr($filename,rindex($filename,".")); #changed index to rindex
######
that seems to have solved the problem. it also eliminates problems with spaces in filename. does anyone see a problem with this?
Code:
###### hack for array filenames
$filename = $newfile[int($Number)] . substr($filename,index($filename,"."));
######
if i understand this correctly, index finds the FIRST occurence of "." and uses all original filename from that point on. i changed code to:
Code:
###### hack for array filenames
$filename = $newfile[int($Number)] . substr($filename,rindex($filename,".")); #changed index to rindex
######
that seems to have solved the problem. it also eliminates problems with spaces in filename. does anyone see a problem with this?