]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/File.php
add some info about plugins
[quix0rs-gnu-social.git] / classes / File.php
index 533cc6e71dbe12792c077070cab82c71e21d4a10..56d9f982783a8e6815fae7e8b07ec89724223e21 100644 (file)
@@ -193,5 +193,18 @@ class File extends Memcached_DataObject
 
         return 'http://'.$server.$path.$filename;
     }
+
+    function isEnclosure(){
+        if(isset($this->filename)){
+            return true;
+        }
+        $notEnclosureMimeTypes = array('text/html','application/xhtml+xml');
+        $mimetype = strtolower($this->mimetype);
+        $semicolon = strpos($mimetype,';');
+        if($semicolon){
+            $mimetype = substr($mimetype,0,$semicolon);
+        }
+        return(! in_array($mimetype,$notEnclosureMimeTypes));
+    }
 }