Determine URL file type from path, strip query parameters first
authorChristian Weiske <cweiske@cweiske.de>
Thu, 22 Sep 2016 09:39:11 +0000 (11:39 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Thu, 22 Sep 2016 09:39:11 +0000 (11:39 +0200)
src/shpub/Command/AbstractProps.php

index 7707ea9..90cc0ff 100644 (file)
@@ -215,8 +215,9 @@ class Command_AbstractProps
         foreach ($files as $filePath) {
             if (strpos($filePath, '://') !== false) {
                 //url
+                $urlPath  = parse_url($filePath, PHP_URL_PATH);
                 $mte      = new \MIME_Type_Extension();
-                $mimetype = $mte->getMIMEType($filePath);
+                $mimetype = $mte->getMIMEType($urlPath);
                 $media    = \MIME_Type::getMedia($mimetype);
                 if (!isset($urlList[$media])) {
                     Log::err('File type not allowed: ' . $mimetype);