inc/dns.inc.php
changeset 186 a3e83a34f267
parent 182 049347a649e0
child 192 3d18290ac993
equal deleted inserted replaced
185:6baa2f78d3fe 186:a3e83a34f267
   350 
   350 
   351 	return true;
   351 	return true;
   352 }
   352 }
   353 
   353 
   354 function is_valid_rr_srv_name($name){
   354 function is_valid_rr_srv_name($name){
       
   355 
       
   356 	if (strlen($name) > 255) {
       
   357 		error(ERR_DNS_HN_TOO_LONG);
       
   358 		return false;
       
   359 	}
       
   360 
   355 	$fields = explode('.', $name, 3);
   361 	$fields = explode('.', $name, 3);
   356 	if (!preg_match('/^_[a-z0-9]+$/i', $fields[0])) { error(ERR_DNS_SRV_NAME) ; return false; }
   362 	if (!preg_match('/^_[\w-]+$/i', $fields[0])) { error(ERR_DNS_SRV_NAME) ; return false; }
   357 	if (!preg_match('/^_[a-z0-9]+$/i', $fields[1])) { error(ERR_DNS_SRV_NAME) ; return false; }
   363 	if (!preg_match('/^_[\w]+$/i', $fields[1])) { error(ERR_DNS_SRV_NAME) ; return false; }
   358 	if (!is_valid_hostname_fqdn($fields[2],0)) { error(ERR_DNS_SRV_NAME) ; return false ; }
   364 	if (!is_valid_hostname_fqdn($fields[2],0)) { error(ERR_DNS_SRV_NAME) ; return false ; }
   359 	return true ;
   365 	return true ;
   360 }
   366 }
   361 
   367 
   362 function is_valid_rr_srv_content($content) {
   368 function is_valid_rr_srv_content($content) {