コード例 #1
0
 public function allow()
 {
     $args = func_get_args();
     for ($a = 0, $len = count($args); $a < $len; $a++) {
         $extension = Sanitize::variable($args[$a]);
         if (!in_array($extension, $this->allowedExtensions)) {
             $this->allowedExtensions[] = $extension;
             $mimeTypes = MimeType::get($extension);
             foreach ($mimeTypes as $value) {
                 $value = Sanitize::variable($value, "./-");
                 if (!in_array($value, $this->allowedMimes)) {
                     $this->allowedMimes[] = $value;
                 }
             }
         }
     }
 }
コード例 #2
0
 /**
  * Modify the src="" element to be joined with the mail as an inline statement
  *
  * @param Array $aMatches
  *
  * @return String
  */
 public function inlineAttachment($aMatches)
 {
     $sCID = $this->_cidGenerate();
     try {
         $this->addAttachment($aMatches[1], MimeType::get($aMatches[1]), null, null, $sCID);
         return 'src="cid:' . $sCID . '"';
     } catch (Exception $oE) {
         return $aMatches[0];
     }
 }