inc/dns.inc.php
changeset 97 090be08858db
parent 96 35cd9e082b90
child 119 f74e4f88b680
equal deleted inserted replaced
96:35cd9e082b90 97:090be08858db
    59 			$ip6 = true;
    59 			$ip6 = true;
    60 		}
    60 		}
    61 	}
    61 	}
    62 
    62 
    63 	// Prepare total hostname.
    63 	// Prepare total hostname.
    64 
       
    65 	if ($name == '*') {
    64 	if ($name == '*') {
    66 		$wildcard = true;
    65 		$wildcard = true;
    67 	} else {
    66 	} else {
    68 		$wildcard = false;
    67 		$wildcard = false;
    69 	}
    68 	}
    70 
    69 
    71 	if (preg_match('!@\.!i', $name))
    70 	if (preg_match("/@/", $name)) {
    72 	{
    71 		$name = $domain ;
    73 		$name = str_replace('@.', '@', $name);
    72 	} elseif ( !(preg_match("/$domain$/i", $name))) {
    74 	}
    73 
    75 	
    74 		if ( isset($name) && $name != "" ) {
    76 	if ($name == "" || $name == "@") {
    75 			$name = $name . "." . $domain ;
    77 		$test_name = $domain;
    76 		} else {
    78 	} else {
    77 			$name = $domain ;
    79 		$test_name = $name . "." . $domain ;
    78 		}
    80 	}
    79 	}
    81 
    80 
    82 	if(!$wildcard) {
    81 	if(!$wildcard) {
    83 		if(!is_valid_hostname($test_name)) {
    82 		if(!is_valid_hostname($name)) {
    84 			error(ERR_DNS_HOSTNAME);
    83 			error(ERR_DNS_HOSTNAME);
    85 			return false;
    84 			return false;
    86 		}
    85 		}
    87 	}
    86 	}
    88 
    87