From f76355c4abe55be89c91061533d01e689325c51f Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Fri, 12 Jun 2009 14:00:55 +0000 Subject: Fixed bug in validation caused by Lua special characters. --- fetchmail-model.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fetchmail-model.lua b/fetchmail-model.lua index 9dde434..bb74348 100644 --- a/fetchmail-model.lua +++ b/fetchmail-model.lua @@ -301,11 +301,11 @@ local function validateentry(entry) success = modelfunctions.validateselect(entry.value.method) and success success = modelfunctions.validateselect(entry.value.envelope) and success - if string.find(entry.value.remotehost.value, "[^%w.-]") then + if string.find(entry.value.remotehost.value, "[^%w%.%-]") then entry.value.remotehost.errtxt = "Invalid entry - may only contain alphanumeric, '.', or '-'" success = false end - if string.find(entry.value.remotemailbox.value, "[^%w.-_@]") then + if string.find(entry.value.remotemailbox.value, "[^%w%.%-_@]") then entry.value.remotemailbox.errtxt = "Invalid entry" success = false end @@ -313,15 +313,15 @@ local function validateentry(entry) entry.value.remotepassword.errtxt = "Invalid entry - cannot contain whitespace" success = false end - if string.find(entry.value.localhost.value, "[^%w.-]") then + if string.find(entry.value.localhost.value, "[^%w%.%-]") then entry.value.localhost.errtxt = "Invalid entry - may only contain alphanumeric, '.', or '-'" success = false end - if string.find(entry.value.localmailbox.value, "[^%w.-_@]") then + if string.find(entry.value.localmailbox.value, "[^%w%.%-_@]") then entry.value.localmailbox.errtxt = "Invalid entry" success = false end - if string.find(entry.value.localdomain.value, "[^%w.-]") then + if string.find(entry.value.localdomain.value, "[^%w%.%-]") then entry.value.localdomain.errtxt = "Invalid entry - may only contain alphanumeric, '.', or '-'" success = false end -- cgit v1.2.3