about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-08-01 14:04:20 -0500
committermultiple creatures <dev@multiple-creature.party>2019-08-01 14:04:20 -0500
commitc4bf59ed9c9b1dba6b0c18aca9fac0438db110ab (patch)
tree46383a226667d6f55c30e2c0daab358a32d016bc /app
parent6bc75ce03b33c2cb62f82895784967a5feb215e7 (diff)
fix borkage caused by trying to concatinate `nil` values
Diffstat (limited to 'app')
-rw-r--r--app/lib/sanitize_config.rb6
1 files 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)