Skip to content

Commit

Permalink
Fixed issue #5933: Uploaded files with uppercase extensions show plac…
Browse files Browse the repository at this point in the history
…eholder instead of image
  • Loading branch information
c-schmitz committed Mar 20, 2012
1 parent 849aad6 commit 2603d98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/uploader.js
Expand Up @@ -21,7 +21,7 @@ $(document).ready(function(){
"<table align='center'><tr>"+
"<td align='center' width='50%' padding='20px' >";

if (isValueInArray(image_extensions, json[i-1].ext))
if (isValueInArray(image_extensions, json[i-1].ext.toLowerCase()))
previewblock += "<img src='"+rooturl+"/uploader.php?sid="+surveyid+"&amp;filegetcontents="+json[i-1].filename+"' height='60px' />"+decodeURIComponent(json[i-1].name);
else
previewblock += "<img src='"+rooturl+"'/images/placeholder.png' height='60px' /><br />"+decodeURIComponent(json[i-1].name);
Expand Down Expand Up @@ -134,7 +134,7 @@ $(document).ready(function(){
"<td align='center' width='50%'>";

// If the file is not an image, use a placeholder
if (isValueInArray(image_extensions, metadata.ext))
if (isValueInArray(image_extensions, metadata.ext.toLowerCase()))
previewblock += "<img src='"+rooturl+"/uploader.php?sid="+surveyid+"&amp;filegetcontents="+decodeURIComponent(metadata.filename)+"' height='60px' />";
else
previewblock += "<img src='"+rooturl+"/images/placeholder.png' height='60px' />";
Expand Down

0 comments on commit 2603d98

Please sign in to comment.