4images Forum & Community

4images Help / Hilfe => Bug Fixes & Patches => Topic started by: V@no on March 18, 2010, 01:41:51 PM

Title: [1.7 - 1.7.7] uploading thumbnails fails due to missing MIME type
Post by: V@no on March 18, 2010, 01:41:51 PM
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"
    );