From 0b58fb9aa5dbfca5a83a69e28e3947c671a4198a Mon Sep 17 00:00:00 2001 From: Christopher Guess Date: Tue, 26 May 2020 22:54:15 -0400 Subject: [PATCH] Correct html cleanup functions Somehow a bunch of the cleanup functions are return nil probably due to some debuggin that got stuck. This caused Wordpress responses not have a body, which is now fixed. Resolves #31 --- app/controllers/articles_controller.rb | 1 - app/models/cms.rb | 14 ++++++++++---- app/models/joomla_occrp.rb | 4 +++- app/models/wordpress.rb | 4 +--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index fbfbd9e2..585660d8 100755 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -201,7 +201,6 @@ def clean_up_response(articles) article["body"] = scrubScriptTagsFromHTMLString article["body"] article["body"] = scrubJSCommentsFromHTMLString article["body"] article["body"] = scrubSpecialCharactersFromSingleLinesInHTMLString article["body"] - article["body"] = scrubHTMLSpecialCharactersInHTMLString article["body"] article["headline"] = HTMLEntities.new.decode(article["headline"]) end diff --git a/app/models/cms.rb b/app/models/cms.rb index 19a71f5f..b7df4972 100755 --- a/app/models/cms.rb +++ b/app/models/cms.rb @@ -405,10 +405,12 @@ def self.scrubWordpressTagsFromHTMLString(html_string) # rubocop:disable Naming/ html_string end - def self.scrubCDataTags(html_string) # rubocop:disable Naming/MethodName - # scrubbed = html_string.gsub("//