diff --git a/apps/dashboard/app/controllers/widgets_controller.rb b/apps/dashboard/app/controllers/widgets_controller.rb index cdd2b724d7..127a635e77 100644 --- a/apps/dashboard/app/controllers/widgets_controller.rb +++ b/apps/dashboard/app/controllers/widgets_controller.rb @@ -2,7 +2,6 @@ # The Controller to render widget templates without any layout furniture class WidgetsController < ApplicationController - def show widget_path = File.join('/widgets', params[:widget_path]) @@ -11,7 +10,6 @@ def show return end - widget_exists = lookup_context.exists?(widget_path, [], true) unless widget_exists render plain: "404 Widget not found: #{widget_path}", status: :not_found @@ -25,7 +23,6 @@ def show # Checks if the widget path contains only allowed characters def valid_path?(widget_path) - widget_path.match?(/\A[a-zA-Z0-9_\-\/]+\z/) + widget_path.match?(%r{\A[a-zA-Z0-9_\-/]+\z}) end end -