You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2018/02/20 19:01:16 UTC

[incubator-ponymail] branch master updated: Bug: Inconsistent LID validation - don't require min 3 chars

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail.git


The following commit(s) were added to refs/heads/master by this push:
     new 7962c32  Bug: Inconsistent LID validation - don't require min 3 chars
7962c32 is described below

commit 7962c32241c4afe455504b23d1e829da2fa2c35e
Author: Sebb <se...@apache.org>
AuthorDate: Tue Feb 20 19:01:15 2018 +0000

    Bug: Inconsistent LID validation - don't require min 3 chars
    
    Partial implementation of #356
---
 CHANGELOG.md             | 1 +
 site/api/preferences.lua | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 28012a8..03e8cf7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,7 @@
 ## Changes in 0.11-SNAPSHOT
 - Bug: Indentation in mail content (leading white-space) not shown (#432)
 - Bug: does not make sense to allow empty domain name in LID (#434)
+- Bug: Inconsistent LID validation - don't require min 3 chars (#356)
 
 ## CHANGES in 0.10:
 - Bug: Use correct dependency order to fix OAuth login problem (#431)
diff --git a/site/api/preferences.lua b/site/api/preferences.lua
index 7f20f65..49dc44e 100644
--- a/site/api/preferences.lua
+++ b/site/api/preferences.lua
@@ -331,8 +331,9 @@ Pony Mail - Email for Ponies and People.
     local lists = {}
     for listname, entry in pairs(listcounts) do
         local _, list, domain = aaa.parseLid(listname)
-        -- TODO is it necessary to check the lengths?
-        if list and domain and #list > 0 and #domain > 3 then
+        -- Note: the default implementation ensures that list and domain are non-empty
+        -- Check lengths just in case a local version does not do so  
+        if list and domain and #list > 0 and #domain > 0 then
             -- there may be both private and public docs in the list
             for privacy, recent_count in pairs(entry) do
                 local isPublic = privacy == 'false'

-- 
To stop receiving notification emails like this one, please contact
sebb@apache.org.