summaryrefslogtreecommitdiff
path: root/classes/File.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-07-14 13:33:40 -0400
committerCraig Andrews <candrews@integralblue.com>2009-07-14 13:33:40 -0400
commit593af9feb6cdbb88e250501938722e656fe4a17a (patch)
tree8f65c960e4bb2b69962f7340a1ea2031ee1af475 /classes/File.php
parente047ba52c7c3f5953336d46fd22715d880002720 (diff)
Moved the decision logic as to whether an attachment should be an enclosure to the File class
Diffstat (limited to 'classes/File.php')
-rw-r--r--classes/File.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/classes/File.php b/classes/File.php
index 533cc6e71..289c6e441 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -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');
+ $mimetype = strtolower($this->mimetype);
+ $semicolon = strpos($mimetype,';');
+ if($semicolon){
+ $mimetype = substr($mimetype,0,$semicolon);
+ }
+ return(! in_array($mimetype,$notEnclosureMimeTypes));
+ }
}