Example #1
0
 /**
  */
 protected function _write($filename, Horde_Mime_Part $part)
 {
     global $browser;
     try {
         $this->_vfs->write($this->_vfspath, $this->_id, $filename, true);
     } catch (Horde_Vfs_Exception $e) {
         throw new IMP_Compose_Exception($e);
     }
     // Prevent 'jar:' attacks on Firefox.  See Ticket #5892.
     $type = $part->getType();
     if ($browser->isBrowser('mozilla') && in_array(Horde_String::lower($type), array('application/java-archive', 'application/x-jar'))) {
         $type = 'application/octet-stream';
     }
     $md = $this->getMetadata();
     $md->filename = $part->getName(true);
     $md->time = time();
     $md->type = $type;
     $this->saveMetadata($md);
 }