From 6750e75bd89714fc4c390e8501121671fae65a8e Mon Sep 17 00:00:00 2001 From: Bilel Kihal <61744974+Bilelkihal@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:21:56 +0200 Subject: [PATCH] Fix: Annotator fast context special chars issues & statistics page syntax error (#561) * fix statistics page syntax error * update ontoportal instances home section title * fix fast context option in annotator page * remove special chars from annotator's input on submit to avoid errors --- app/controllers/annotator_controller.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/controllers/annotator_controller.rb b/app/controllers/annotator_controller.rb index 6f1ec810b8..c809b15857 100644 --- a/app/controllers/annotator_controller.rb +++ b/app/controllers/annotator_controller.rb @@ -210,5 +210,13 @@ def remove_special_chars(input) input end + def remove_special_chars(input) + regex = /^[a-zA-Z0-9\s]*$/ + unless input.match?(regex) + input.gsub!(/[^\w\s]/, '') + end + input + end + end