diff options
author | Yehuda Hassine <yehuda@myinbox.in> | 2019-04-22 00:23:38 +0300 |
---|---|---|
committer | Yehuda Hassine <yehuda@myinbox.in> | 2019-04-22 00:23:38 +0300 |
commit | 7781aa65cef32d8c8196979edb21ec4551e5b904 (patch) | |
tree | 2a7944400ede6a9a574a83ce89d010b26628fe02 /Postman/PostmanUtils.php | |
parent | dad9828e8c866e50d6e44aebd103f1ab97409a5b (diff) | |
download | Post-SMTP-7781aa65cef32d8c8196979edb21ec4551e5b904.zip |
better meta query,bugs, optimization
Diffstat (limited to 'Postman/PostmanUtils.php')
-rw-r--r-- | Postman/PostmanUtils.php | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/Postman/PostmanUtils.php b/Postman/PostmanUtils.php index 5b42270..6858fe3 100644 --- a/Postman/PostmanUtils.php +++ b/Postman/PostmanUtils.php @@ -447,7 +447,7 @@ class PostmanUtils { } public static function getServerName() { - $host = 'localhost.localdomain'; + $host = 'localhost'; if (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER)) { $host = $_SERVER['SERVER_NAME']; @@ -457,22 +457,6 @@ class PostmanUtils { $host = php_uname('n'); } - // as final option - if ip returned or hostname without extension (not valid dns name) - $extension = pathinfo( $host, PATHINFO_EXTENSION ); - if ( filter_var( $host, FILTER_VALIDATE_IP ) || empty( $extension ) ) { - $siteurl = get_bloginfo('url'); - $temp_host = parse_url( $siteurl, PHP_URL_HOST); - - $dnsr = dns_get_record( $temp_host, DNS_A ); - $ip = gethostbyname( $temp_host ); - - foreach ( $dnsr as $record ) { - if ( $record['host'] == $temp_host && $record['ip'] == $ip ) { - $host = $temp_host; - } - } - } - return str_replace('www.', '', $host ); } |