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 2020/10/06 19:13:19 UTC
[whimsy] branch master updated: Basic template name validation
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 <se...@apache.org>
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
-@reminder.untaint if @reminder =~ /^reminder\d$/
-@reminder.untaint 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