]> cat aescling's git repositories - mastodon.git/commitdiff
Allow VerifyLinkService to accept backlinks with differing case (#18320)
authorSara Golemon <pollita@php.net>
Thu, 5 May 2022 22:41:42 +0000 (17:41 -0500)
committersingle-right-quote <11325618-aescling@users.noreply.gitlab.com>
Fri, 27 May 2022 03:32:55 +0000 (23:32 -0400)
app/services/verify_link_service.rb

index 878a2188dc30399090c42f98a52c34429e2b2ebf..0a39d7f26efa00bc310c8cdc2c051dab6a7f1082 100644 (file)
@@ -28,7 +28,7 @@ class VerifyLinkService < BaseService
 
     links = Nokogiri::HTML(@body).xpath('//a[contains(concat(" ", normalize-space(@rel), " "), " me ")]|//link[contains(concat(" ", normalize-space(@rel), " "), " me ")]')
 
-    if links.any? { |link| link['href'] == @link_back }
+    if links.any? { |link| link['href'].downcase == @link_back.downcase }
       true
     elsif links.empty?
       false