Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-589

Create universal file mime type detection function

    XMLWordPrintable

    Details

    • Additional information:
      Hide

      Mime types for any OpenOffice documents not used (needs to be added to the new "mime_content_type" function:

      'application/vnd.sun.xml.writer',
      'application/vnd.sun.xml.calc',
      'application/vnd.sun.xml.impress',
      'application/vnd.sun.xml.draw',
      'application/vnd.sun.xml.math',
      'application/vnd.oasis.opendocument.text',
      'application/vnd.oasis.opendocument.text-web',
      'application/vnd.oasis.opendocument.text-master',
      'application/vnd.oasis.opendocument.graphics',
      'application/vnd.oasis.opendocument.presentation',
      'application/vnd.oasis.opendocument.spreadsheet',
      'application/vnd.oasis.opendocument.chart',
      'application/vnd.oasis.opendocument.formula',
      'application/vnd.oasis.opendocument.database',
      'application/vnd.oasis.opendocument.image',

      We need to use proposed function where applicable and create a new patch for testing.

      Show
      Mime types for any OpenOffice documents not used (needs to be added to the new "mime_content_type" function: 'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.calc', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.math', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-web', 'application/vnd.oasis.opendocument.text-master', 'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.chart', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.database', 'application/vnd.oasis.opendocument.image', We need to use proposed function where applicable and create a new patch for testing.
    • Story Points:
      1
    • External issue ID:
      742
    • Copy Issue Key:
    • Patch Instructions:

      Patches must be submitted through Phabricator.

      Description

      For now we are using "mime_content_type" function, that is no longer available in PHP5. There is also "finfo_file" function, that is quite modern and gives better result, then "mime_content_type" does. Unfortunately on PHP4 it's only available as PECL extension and not installed by default. In PHP5 it is compiled by default.

      We also have some code in kEmailSendingHelper class, that allows to detect mime type, based only on file extension.

      I propose we combine all described above into one single function and use it later (function available in "universal_mime_detection.patch" file).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: