Changeset 26

Show
Ignore:
Timestamp:
13.04.2007 17:10:39 (2 years ago)
Author:
bobe
Message:

php_uname() prioritaire + correction formatage du numéro de version

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mailer.class.php

    r22 r26  
    3838} 
    3939 
    40 if( isset($_SERVER['SERVER_NAME']) ) { 
    41     $hostname = $_SERVER['SERVER_NAME']; 
    42 
    43 else if( !($hostname = @php_uname('n')) ) { 
    44     $hostname = 'localhost'; 
     40if( !($hostname = @php_uname('n')) ) { 
     41    $hostname = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost'; 
    4542} 
    4643 
     
    183180    public static function send(Email $email) 
    184181    { 
    185         $email->headers->set('X-Mailer', sprintf('Wamailer/%.1f', self::VERSION)); 
     182        $email->headers->set('X-Mailer', sprintf('Wamailer/%s', self::VERSION)); 
    186183         
    187184        $rPath = $email->headers->get('Return-Path'); 
  • trunk/smtp.class.php

    r24 r26  
    117117        } 
    118118         
    119         if( isset($_SERVER['SERVER_NAME']) ) { 
    120             $domain = $_SERVER['SERVER_NAME']; 
    121         } 
    122         else if( !($domain = @php_uname('n')) ) { 
    123             $domain = 'localhost'; 
     119        if( !($hostname = @php_uname('n')) ) { 
     120            $hostname = isset($_SERVER['SERVER_NAME']) ? 
     121                $_SERVER['SERVER_NAME'] : 'localhost'; 
    124122        } 
    125123         
     
    149147        // Code error   : 500, 501, 504, 421 
    150148        // 
    151         $this->put(sprintf("EHLO %s\r\n", $domain)); 
     149        $this->put(sprintf("EHLO %s\r\n", $hostname)); 
    152150        if( !$this->checkResponse(250) ) { 
    153             $this->put(sprintf("HELO %s\r\n", $domain)); 
     151            $this->put(sprintf("HELO %s\r\n", $hostname)); 
    154152            if( !$this->checkResponse(250) ) { 
    155153                return false;