[Home]WikiBugs/UppercaseImageUploadCausesProblemsWithDisplay

UseModWiki | WikiBugs | RecentChanges | Preferences

Fixed and .ico added in 1.0.2 --MarkusLude

When user has uploaded a file with UPPERCASE.JPG, it was not shown as image -- [[TomGries] 15.03.2004

Additional patch: add "*.ico" to the list of $ImageExtensions

 $ImageExtensions = "(gif|jpg|png|bmp|jpeg|ico)";


Here is the simple Patch to solve the problem with mixed-cased image filenames, it allows image filename to have upper- or lowercase extensions (and filenames):

add the letter i to the string match expression in sub ImageAllowed to make it case insensitive; this allows image extensions such as jpg, gif, png to have any (lower or upper) case such as JPG, GIF, PNG:

sub ImageAllowed {
...
  return 0  unless ($url =~ /^($imagePrefixes).+\.$ImageExtensions$/i);


I would think this is not a bug but a feature to control the representation of an image file. Isn't it? --AndreasSchindler?
Andreas, no I don't think so -- do you have a page here or an E-mail, where I can answer you directly ? TomGries <-- my emailaddress is there
Some users have uploaded files with filenames in uppercase such as MYIMAGE.JPG (for example form an OS/2 system with FAT32). The users edited wiki-pages with links like upload:MYIMAGE.JPG but these links were shown as <a href=...../MYIMAGE.JPG>MYIMAGE.JPG</a> instead of the wanted <img src=...../MYIMAGE.JPG>.
Thus, these images were not shown as such. If you run your own wiki, try my patch, and I guess you will also think of it as a small bug with big user impact. But I'm interested in your opinion. Tom, Berlin

UseModWiki | WikiBugs | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited August 30, 2007 6:55 pm by MarkusLude (diff)
Search: