summaryrefslogtreecommitdiff
path: root/Postman/PostmanUtils.php
diff options
context:
space:
mode:
authorYehuda Hassine <yehuda@myinbox.in>2019-04-22 00:23:38 +0300
committerYehuda Hassine <yehuda@myinbox.in>2019-04-22 00:23:38 +0300
commit7781aa65cef32d8c8196979edb21ec4551e5b904 (patch)
tree2a7944400ede6a9a574a83ce89d010b26628fe02 /Postman/PostmanUtils.php
parentdad9828e8c866e50d6e44aebd103f1ab97409a5b (diff)
downloadPost-SMTP-7781aa65cef32d8c8196979edb21ec4551e5b904.zip
better meta query,bugs, optimization
Diffstat (limited to 'Postman/PostmanUtils.php')
-rw-r--r--Postman/PostmanUtils.php18
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 );
}