Changeset 885 for trunk/Modules/File


Ignore:
Timestamp:
Sep 8, 2020, 5:57:23 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: MimeTypes for file download was not working as global variable with newer PHP 7.4.
Location:
trunk/Modules/File
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/File/File.php

    r876 r885  
    4343  function DetectMimeType($FileName)
    4444  {
    45     global $MimeTypes;
    46 
    47     $Result = $MimeTypes[pathinfo($FileName, PATHINFO_EXTENSION)][0];
     45    $MimeTypes = GetMimeTypes();
     46    $MimeType = pathinfo($FileName, PATHINFO_EXTENSION);
     47    $Result = $MimeTypes[$MimeType][0];
    4848    return $Result;
    4949  }
  • trunk/Modules/File/MimeTypes.php

    r738 r885  
    11<?php
    22
    3 $MimeTypes = array(
     3function GetMimeTypes()
     4{
     5  return array(
    46  '7z'    => array('application/x-7z-compressed'),
    57  'ai'    => array('application/postscript'),
     
    123125  'xsl'   => array('text/xml'),
    124126  'zip'   => array('application/x-zip', 'application/zip', 'application/x-zip-compressed')
    125 );
     127  );
     128}
Note: See TracChangeset for help on using the changeset viewer.