]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Mimetype.php
Fixed: ?? didn't work here as bool won't be seen as null
[friendica.git] / src / Util / Mimetype.php
index bd87d30898a4abfac7940e412dfecb5d6b1026cc..ca57648771532e7691a65c699ba5afb65c894e9b 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -29,7 +29,7 @@ class Mimetype
         * @param string $filename filename
         * @return mixed array or string
         */
-       public static function getContentType($filename)
+       public static function getContentType(string $filename)
        {
                $mime_types = [
        
@@ -1088,7 +1088,7 @@ class Mimetype
                        'zsh' => 'text/x-script.zsh'
                ];
        
-               $dot = strpos($filename, '.');
+               $dot = strrpos($filename, '.');
                if ($dot !== false) {
                        $ext = strtolower(substr($filename, $dot + 1));
                        if (array_key_exists($ext, $mime_types)) {