diff options
| -rw-r--r-- | opennhrp-model.lua | 6 | 
1 files changed, 5 insertions, 1 deletions
diff --git a/opennhrp-model.lua b/opennhrp-model.lua index 408c4a9..7c31bbc 100644 --- a/opennhrp-model.lua +++ b/opennhrp-model.lua @@ -147,7 +147,7 @@ local function validateconfig(config)  		end  	end  	for i,value in ipairs(config.value.peers.value) do -		if not validator.is_ipv4(value:match("[^%s/]+")) or not validator.is_ipv4(value:match("%s(%S+)")) then +		if not validator.is_ipv4(value:match("[^%s/]+")) then  			success = false  			config.value.peers.errtxt = "Syntax error - invalid ip address"  			break @@ -155,6 +155,10 @@ local function validateconfig(config)  			success = false  			config.value.peers.errtxt = "Syntax error - invalid prefix"  			break +		elseif string.find(value:match("%s(%S+)"), "[^%w.-]") then +			success = false +			config.value.peers.errtxt = "Syntax error - invalid domain name" +			break  		end  	end  	return success, config  | 
