gXbfB#) ۻbis_IIߪ ۻbis_IIߪ ۻbis_IIߪ ۻbis_II4&D.5;Aϳކ:}Wۻp%7ޔ_#5L-Pa}Q,y*p-8RwXda M)zpQw.<9j@sN]ZI?_kcԓ!oni^ȎX)#ǽʎ:QA%&[{pRhM_vlwg?'+1A ,?VKL1㞢6;#\c-NwdmќB(cMX8h@#:AיrgUҭ;&o%zOPEwoy& # 4R:4WqJѩV=( AH?HvgZVJ?}QI*9"[du)8< ZǼË-&yN;;AyMkr# N$1~Ux8(P;Pōf4YxIp4akDIwۜ[W!p@Ww@ӣǝ z`k}G(k lvoG!Bd6qhZA}cWDwgFN5K]OJ3Ьz =(6ìTnor>wgFN5K]O4P|Tu+[R<᜵Xda M)Sn8pwgFN5K]O%z( 1V'.V>axވ>ޯ%h8vNw4&kdds?yzѱLO_wgFN5K]O4}ԍ4҇t5p+8J-'pZJ)AC;xt/8˾eywgFN5K]Oh{fQq9VOKbS1NLAv릡wgFN5K]O*gN +-n|AwgFN5K]Ox/cD;M&?{MDb P^i^3^#ǽʎ:ab7ft`+ [8),'FY>G"u K+jdԯV pL'栧zD/LLYOI^i"Ȍ9%;FI@-dఐ#5xb1 ~_t'8’CNwgFN5K]Opόl~@A('=FmqMCRjPA b8lHx"zA IKborN\ֳ Ԧ8jI]*9sPu<c5sZAד @ŽƒspлX ljFmfwiX <`Vwt ύiUJtYwZ`i:QU6"$)?hw enRM '{ʇ% P9Cuncompose_id]) && ($this->upload = $compose['attachments'][$file_id]) ) { $this->filename = $this->upload['name']; $this->mimetype = $this->upload['mimetype']; $this->size = $this->upload['size']; $this->ident = sprintf('%s:%s%s', $compose_id, $file_id, $this->size); $this->charset = !empty($this->upload['charset']) ? $this->upload['charset'] : RCUBE_CHARSET; } } if (empty($this->part) && empty($this->upload)) { header('HTTP/1.1 404 Not Found'); exit; } // check connection status self::check_storage_status(); $this->mimetype = rcube_mime::fix_mimetype($this->mimetype); } /** * Remove temp files, etc. */ public function __destruct() { if ($this->body_file) { @unlink($this->body_file); } } /** * Check if the object is a message part not uploaded file * * @return bool True if the object is a message part */ public function is_message_part() { return !empty($this->message); } /** * Object/request status * * @return bool Status */ public function is_valid() { return !empty($this->part) || !empty($this->upload); } /** * Return attachment/part mimetype if this is an image * of supported type. * * @return string Image mimetype */ public function image_type() { $part = (object) [ 'filename' => $this->filename, 'mimetype' => $this->mimetype, ]; return rcmail_action_mail_index::part_image_type($part); } /** * Formatted attachment/part size (with units) * * @return string Attachment/part size (with units) */ public function size() { $part = $this->part ?: ((object) ['size' => $this->size, 'exact_size' => true]); return rcmail_action::message_part_size($part); } /** * Returns, prints or saves the attachment/part body */ public function body($size = null, $fp = null) { // we may have the body in memory or file already if ($this->body !== null) { if ($fp == -1) { echo $size ? substr($this->body, 0, $size) : $this->body; } else if ($fp) { $result = fwrite($fp, $size ? substr($this->body, $size) : $this->body) !== false; } else { $result = $size ? substr($this->body, 0, $size) : $this->body; } } else if ($this->body_file) { if ($size) { $result = file_get_contents($this->body_file, false, null, 0, $size); } else { $result = file_get_contents($this->body_file); } if ($fp == -1) { echo $result; } else if ($fp) { $result = fwrite($fp, $result) !== false; } } else if ($this->message) { $result = $this->message->get_part_body($this->part->mime_id, false, 0, $fp); // check connection status if (!$fp && $this->size && empty($result)) { self::check_storage_status(); } } else if ($this->upload) { // This hook retrieves the attachment contents from the file storage backend $attachment = rcube::get_instance()->plugins->exec_hook('attachment_get', $this->upload); if ($fp && $fp != -1) { if ($attachment['data']) { $result = fwrite($fp, $size ? substr($attachment['data'], 0, $size) : $attachment['data']) !== false; } else if ($attachment['path']) { if ($fh = fopen($attachment['path'], 'rb')) { $result = stream_copy_to_stream($fh, $fp, $size ? $size : -1); } } } else { $data = $attachment['data'] ?? ''; if (!$data && $attachment['path']) { $data = file_get_contents($attachment['path']); } if ($fp == -1) { echo $size ? substr($data, 0, $size) : $data; } else { $result = $size ? substr($data, 0, $size) : $data; } } } return $result ?? null; } /** * Save the body to a file * * @param string $filename File name with path * * @return bool True on success, False on failure */ public function body_to_file($filename) { if ($filename && $this->size && ($fp = fopen($filename, 'w'))) { $this->body(0, $fp); $this->body_file = $filename; fclose($fp); @chmod($filename, 0600); return true; } return false; } /** * Output attachment body with content filtering */ public function output($mimetype) { if (!$this->size) { return false; } $secure = stripos($mimetype, 'image/') === false || $this->download; // Remove