ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
IsMimeTypeOrExtension.php
Go to the documentation of this file.
1 <?php
2 
20 
22 
27 {
28  protected function isMimeTypeOrExtension(
29  Metadata $metadata,
30  string $extention,
31  array $mime_types
32  ): bool {
33  // is mime type
34  $mime_type = strtolower($metadata->getMimeType());
35  $mime_types = array_map('strtolower', $mime_types);
36  if (in_array($mime_type, $mime_types, true)) {
37  return true;
38  }
39  // is extension
40  return substr_compare(
41  $metadata->getFilename(),
42  $extention,
43  -strlen($extention),
44  null,
45  true
46  ) === 0;
47  }
48 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...