From a7b0cfe103ff5d8b17d77fb3660589522dd6bcad Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Sun, 1 Dec 2024 14:34:02 -0500 Subject: [PATCH] Combine the noscript/mglyph prevention blocks These were on two separate branches, so let's be smart. --- lib/rails/html/scrubbers.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rails/html/scrubbers.rb b/lib/rails/html/scrubbers.rb index 125e330..606b66b 100644 --- a/lib/rails/html/scrubbers.rb +++ b/lib/rails/html/scrubbers.rb @@ -149,11 +149,11 @@ def validate!(var, name) warn("WARNING: 'malignmark' tags cannot be allowed by the PermitScrubber and will be scrubbed") var.delete("malignmark") end - end - if var && name == :tags && var.include?("noscript") - warn("WARNING: 'noscript' tags cannot be allowed by the PermitScrubber and will be scrubbed") - var.delete("noscript") + if var.include?("noscript") + warn("WARNING: 'noscript' tags cannot be allowed by the PermitScrubber and will be scrubbed") + var.delete("noscript") + end end var