From 4e847e229537578076b2c28fa7ab42cc5c862703 Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Sun, 28 Dec 2014 12:51:47 -0600 Subject: [PATCH] catch for directory edit attempt --- app/site_files.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/site_files.rb b/app/site_files.rb index b4e7b673..3d5507a6 100644 --- a/app/site_files.rb +++ b/app/site_files.rb @@ -115,6 +115,9 @@ get %r{\/site_files\/text_editor\/(.+)} do rescue Errno::ENOENT flash[:error] = 'We could not find the requested file.' redirect '/dashboard' + rescue Errno::EISDIR + flash[:error] = 'Cannot edit a directory.' + redirect '/dashboard' end erb :'site_files/text_editor' end