You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2018/07/30 21:46:21 UTC

[whimsy] branch master updated: Better matching on white-space

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/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 01ab577  Better matching on white-space
01ab577 is described below

commit 01ab5773d631da5afe312178369b2914934196c2
Author: Sebb <se...@apache.org>
AuthorDate: Mon Jul 30 22:46:19 2018 +0100

    Better matching on white-space
---
 www/secretary/ldap-names.cgi | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/www/secretary/ldap-names.cgi b/www/secretary/ldap-names.cgi
index 9f89b66..218b786 100755
--- a/www/secretary/ldap-names.cgi
+++ b/www/secretary/ldap-names.cgi
@@ -114,10 +114,11 @@ _html do
       next if p.banned?
       given = p.givenName rescue '---' # some entries have not set this up
 
-      # Match the name as a word-bounded string
-      givenOK = (p.cn.match(/\b#{Regexp.quote(given)}\b/) != nil)
+      # Match the name as a word-bounded string (but allow for trailing . which is not a word char)
+      givenOK = (p.cn.match(/\b#{Regexp.quote(given)}(\s|$)/) != nil)
       badGiven += 1 unless givenOK
 
+      # surnames don't tend to end with .
       snOK =    (p.cn.match(/\b#{Regexp.quote(p.sn)}\b/) != nil)
       badSN += 1 unless snOK