Exemplo n.º 1
0
 protected function setHeaders()
 {
     $headers =& $this->headers;
     self::cleanHeaders($headers, 'Return-Path|From|Sender|Reply-To|Message-Id|To|Cc|Bcc|Subject');
     foreach (array('To', 'Cc', 'Bcc', 'Reply-To') as $sql) {
         isset($headers[$sql]) && is_array($headers[$sql]) && ($headers[$sql] = implode(', ', $headers[$sql]));
     }
     $message_id = 'pM' . p::uniqId();
     $headers['Message-Id'] = '<' . $message_id . '@' . $_SERVER['HTTP_HOST'] . '>';
     if (empty($headers['Sender'])) {
         if ($CONFIG['pMail.sender']) {
             $headers['Sender'] = $CONFIG['pMail.sender'];
         }
     }
     if (empty($headers['From'])) {
         if (empty($headers['Sender'])) {
             user_error("Email is likely not to be sent: From header is empty.");
         } else {
             $headers['From'] =& $headers['Sender'];
             unset($headers['Sender']);
         }
     }
     if (empty($headers['Return-Path'])) {
         if (isset($headers['Sender'])) {
             $headers['Return-Path'] = $headers['Sender'];
         } else {
             if (isset($headers['From'])) {
                 $headers['Return-Path'] = $headers['From'];
             }
         }
     }
     isset($headers['Return-Path']) && preg_match('/' . FILTER::EMAIL_RX . '/', $headers['Return-Path'], $m) && ($headers['Return-Path'] = '<' . $m[0] . '>');
 }
Exemplo n.º 2
0
 function setFile($isfile)
 {
     if ($isfile && !$this->hasfile) {
         $this->hasfile = true;
         if (function_exists('upload_progress_meter_get_info') || function_exists('uploadprogress_get_info')) {
             $elt = $this->elt['UPLOAD_IDENTIFIER'] = new pForm_hidden($this, 'UPLOAD_IDENTIFIER', array(), $this->sessionLink);
             $elt->setValue(p::uniqId());
             array_unshift($this->hidden, $elt);
         }
     }
 }