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 dc19d0b  Basic template name validation
dc19d0b is described below

commit dc19d0b57af6fdad12c8e7e5abdfdf918febc957
Author: Sebb <[email protected]>
AuthorDate: Tue Oct 6 20:13:10 2020 +0100

    Basic template name validation
---
 www/board/agenda/views/actions/reminder-text.json.rb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/www/board/agenda/views/actions/reminder-text.json.rb 
b/www/board/agenda/views/actions/reminder-text.json.rb
index 7db7ce7..6b298d2 100644
--- a/www/board/agenda/views/actions/reminder-text.json.rb
+++ b/www/board/agenda/views/actions/reminder-text.json.rb
@@ -1,12 +1,11 @@
 require 'active_support/time'
 
+raise ArgumentError, "Invalid syntax #{@reminder}" unless  @reminder =~ 
/\A[-\w]+\z/
 # read template for the reminders
[email protected] if @reminder =~ /^reminder\d$/
[email protected] if @reminder =~ /^non-responsive$/
-template = File.read("#{FOUNDATION_BOARD}/templates/#@reminder.mustache")
+template = File.read(File.join(FOUNDATION_BOARD, 'templates', 
"#{@reminder}.mustache"))
 
 # find the latest agenda
-agenda = Dir["#{FOUNDATION_BOARD}/board_agenda_*.txt"].max
+agenda = Dir[File.join(FOUNDATION_BOARD, 'board_agenda_*.txt')].max
 
 # determine meeting time
 meeting = ASF::Board.nextMeeting

Reply via email to