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 bb51b8c2 Improve syntax checking
bb51b8c2 is described below
commit bb51b8c2731b256a34fb9357b26b2b351713083b
Author: Sebb <[email protected]>
AuthorDate: Wed Aug 2 23:50:06 2023 +0100
Improve syntax checking
---
www/roster/views/actions/memtext.json.rb | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/www/roster/views/actions/memtext.json.rb
b/www/roster/views/actions/memtext.json.rb
index d05ac24e..629e5be3 100644
--- a/www/roster/views/actions/memtext.json.rb
+++ b/www/roster/views/actions/memtext.json.rb
@@ -1,8 +1,9 @@
# validate new entry
new_entry = @entry.strip
-unless new_entry.include? "Forms on File: ASF Membership Application\n" and
- new_entry.include? "Avail ID: #{@userid}\n"
- raise Exception.new('Missing required item: Avail ID and/or Forms')
+#ensure required entries are present as separate lines
+unless new_entry =~ %r{^\s*Forms on File: ASF Membership Application$} and
+ new_entry =~ %r{^\s*Avail ID: #{@userid}$}
+ raise Exception.new('Missing required item: Avail ID and/or Forms, or Avail
ID does not match')
end
# get existing entry for @userid