whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Stricter check: some apps are filed under directories
Date Tue, 26 Nov 2019 12:02:49 GMT
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 13e81fa  Stricter check: some apps are filed under directories
13e81fa is described below

commit 13e81fa4ef06a19a99164c8757734bcb70e43183
Author: Sebb <sebb@apache.org>
AuthorDate: Tue Nov 26 12:02:45 2019 +0000

    Stricter check: some apps are filed under directories
---
 www/secretary/workbench/views/actions/memapp.json.rb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/www/secretary/workbench/views/actions/memapp.json.rb b/www/secretary/workbench/views/actions/memapp.json.rb
index 39c8ffc..04d5ad8 100644
--- a/www/secretary/workbench/views/actions/memapp.json.rb
+++ b/www/secretary/workbench/views/actions/memapp.json.rb
@@ -14,9 +14,11 @@ fileext = File.extname(@selected).downcase if @signature.empty?
 
 # verify that a membership form under that name stem doesn't already exist
 if "#@filename#{fileext}" =~ /^\w[-\w]*\.?\w*$/ # check taint requirements
-  form = "#{ASF::SVN['member_apps']}/#@filename#{fileext}"
-  if File.exist? form.untaint
-    _warn "documents/member_apps/#@filename#{fileext} already exists"
+  require 'asf/whimsy/memapps'
+  # returns name if it matches as stem or fully (e.g. for directory)
+  form = ASF::MemApps.search @filename.untaint
+  if form
+    _warn "documents/member_apps/#{form} already exists"
   end
 else
   _warn "Invalid filename or extension"


Mime
View raw message