Author Topic: [1.7 - 1.7.7] uploading thumbnails fails due to missing MIME type  (Read 9841 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
In some rare cases uploading thumbnail might fail, because the code that checks thumbnail's MIME type totally ignores MIME type that is set in includes/upload_definitions.php

In includes/upload.php find:
    foreach ($mime_type_match as $key => $val) {

Insert below:
      if (in_array($key$this->accepted_extensions['thumb'])) {
        if (
is_array($val)) {
          foreach (
$val as $key2 => $val2) {
            
$this->accepted_mime_types['thumb'][] = $val2;
          }
        }
        else {
          
$this->accepted_mime_types['thumb'][] = $val;
        }
      }



If you wish, you can safely delete this block of code as it's not being used anymore:
    //Thumbnails
    
$this->accepted_mime_types['thumb'] = array(
      
"image/jpg",
      
"image/jpeg",
      
"image/pjpeg",
      
"image/gif",
      
"image/x-png"
    
);
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)