From c4bf59ed9c9b1dba6b0c18aca9fac0438db110ab Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Thu, 1 Aug 2019 14:04:20 -0500 Subject: fix borkage caused by trying to concatinate `nil` values --- app/lib/sanitize_config.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb index af675fba3..914db17b1 100644 --- a/app/lib/sanitize_config.rb +++ b/app/lib/sanitize_config.rb @@ -84,9 +84,9 @@ class Sanitize return if href.start_with?(text) # split href into parts & grab shortened href - uri = Addressable::URI.parse(node['href']) - short_href = uri.host + uri.path - normalized_short_href = uri.normalized_host + uri.normalized_path + uri = Addressable::URI.parse(href) + short_href = "#{uri.host}#{uri.path}" + normalized_short_href = "#{uri.normalized_host}#{uri.normalized_path}" # shortened href starts with link text? return if short_href.start_with?(text) || normalized_short_href.start_with?(text) -- cgit