@@ 916-929 (lines=14) @@ | ||
913 | $file = dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'mime.types'; |
|
914 | } |
|
915 | ||
916 | if ($file && file_exists($file)) { |
|
917 | $mimecf = file($file); |
|
918 | ||
919 | foreach ($mimecf as $line_num => $line) { |
|
920 | if (!preg_match('/^\s*#/', $line)) { |
|
921 | $mime = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY); |
|
922 | for ($i = 1, $size = count($mime); $i < $size ; $i++) { |
|
923 | if (!isset(self::$mimetypes[$mime[$i]])) { |
|
924 | self::$mimetypes[$mime[$i]] = $mime[0]; |
|
925 | } |
|
926 | } |
|
927 | } |
|
928 | } |
|
929 | } |
|
930 | } |
|
931 | ||
932 | $this->rootName = empty($this->options['alias']) ? $this->basenameCE($this->root) : $this->options['alias']; |
|
@@ 3132-3144 (lines=13) @@ | ||
3129 | if (!elFinderVolumeDriver::$mimetypesLoaded) { |
|
3130 | elFinderVolumeDriver::$mimetypesLoaded = true; |
|
3131 | $file = dirname(__FILE__).DIRECTORY_SEPARATOR.'mime.types'; |
|
3132 | if (is_readable($file)) { |
|
3133 | $mimecf = file($file); |
|
3134 | foreach ($mimecf as $line_num => $line) { |
|
3135 | if (!preg_match('/^\s*#/', $line)) { |
|
3136 | $mime = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY); |
|
3137 | for ($i = 1, $size = count($mime); $i < $size ; $i++) { |
|
3138 | if (!isset(elFinderVolumeDriver::$mimetypes[$mime[$i]])) { |
|
3139 | elFinderVolumeDriver::$mimetypes[$mime[$i]] = $mime[0]; |
|
3140 | } |
|
3141 | } |
|
3142 | } |
|
3143 | } |
|
3144 | } |
|
3145 | } |
|
3146 | $pinfo = pathinfo($path); |
|
3147 | $ext = isset($pinfo['extension']) ? strtolower($pinfo['extension']) : ''; |