Update class.phpmailer.php

Function "gethostname" unavailable before PHP 5.3, if function is not defined, use of php_uname('n').
This commit is contained in:
ojovirtual 2014-02-14 11:03:02 +01:00
parent 338dd08618
commit 8a46f63ec2
1 changed files with 3 additions and 1 deletions

View File

@ -2730,8 +2730,10 @@ class PHPMailer
$result = $this->Hostname;
} elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) {
$result = $_SERVER['SERVER_NAME'];
} elseif (gethostname() !== false) {
} elseif (function_exists("gethostname") && gethostname() !== false) {
$result = gethostname();
}elseif (php_uname("n") !== false){
$result = php_uname("n");
}
return $result;
}