summaryrefslogtreecommitdiff
path: root/classes/File.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-08-26 21:51:54 -0400
committerCraig Andrews <candrews@integralblue.com>2009-08-26 21:51:54 -0400
commit504c42aa7d4ff5cccd722bceb3231a5a8f46a27b (patch)
treefe4be84388058f3e541b63928fe32c8fd6ec0f24 /classes/File.php
parent6d60d74093005992701418edda5be4422e46262f (diff)
Fix some stupid bugs, such as a mispelling of oembed
Diffstat (limited to 'classes/File.php')
-rw-r--r--classes/File.php25
1 files changed, 10 insertions, 15 deletions
diff --git a/classes/File.php b/classes/File.php
index 1c64b4d33..58fe91237 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -204,10 +204,8 @@ class File extends Memcached_DataObject
$enclosure->modified=$this->modified;
$enclosure->size=$this->size;
$enclosure->mimetype=$this->mimetype;
-
- if(isset($this->filename)){
- return $enclosure;
- }else{
+
+ if(! isset($this->filename)){
$notEnclosureMimeTypes = array('text/html','application/xhtml+xml');
$mimetype = strtolower($this->mimetype);
$semicolon = strpos($mimetype,';');
@@ -215,9 +213,9 @@ class File extends Memcached_DataObject
$mimetype = substr($mimetype,0,$semicolon);
}
if(in_array($mimetype,$notEnclosureMimeTypes)){
- $ombed = File_oembed::staticGet('file_id',$this->id);
+ $oembed = File_oembed::staticGet('file_id',$this->id);
if($oembed){
- $mimetype = strtolower($ombed->mimetype);
+ $mimetype = strtolower($oembed->mimetype);
$semicolon = strpos($mimetype,';');
if($semicolon){
$mimetype = substr($mimetype,0,$semicolon);
@@ -225,19 +223,16 @@ class File extends Memcached_DataObject
if(in_array($mimetype,$notEnclosureMimeTypes)){
return false;
}else{
- if($ombed->mimetype) $enclosure->mimetype=$ombed->mimetype;
- if($ombed->url) $enclosure->url=$ombed->url;
- if($ombed->title) $enclosure->title=$ombed->title;
- if($ombed->modified) $enclosure->modified=$ombed->modified;
- unset($ombed->size);
+ if($oembed->mimetype) $enclosure->mimetype=$oembed->mimetype;
+ if($oembed->url) $enclosure->url=$oembed->url;
+ if($oembed->title) $enclosure->title=$oembed->title;
+ if($oembed->modified) $enclosure->modified=$oembed->modified;
+ unset($oembed->size);
}
- }else{
- return $enclosure;
}
- }else{
- return $enclosure;
}
}
+ return $enclosure;
}
}