]> cat aescling's git repositories - mastodon.git/commitdiff
Fix performance regression in Account::Field#verifiable? (#8719)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 18 Sep 2018 20:49:24 +0000 (22:49 +0200)
committerGitHub <noreply@github.com>
Tue, 18 Sep 2018 20:49:24 +0000 (22:49 +0200)
* Fix performance regression in Account::Field#verifiable?

Regression from #8703

* Fix code style issue

app/models/account.rb

index 979e0b12c6817b672e089d10ecab84bd27a68c69..d8e5c7340534831817d98b6445a8c799e5ed602e 100644 (file)
@@ -323,7 +323,7 @@ class Account < ApplicationRecord
     end
 
     def verifiable?
-      value.present? && /\A#{FetchLinkCardService::URL_PATTERN}\z/ =~ value
+      value.present? && value.start_with?('http://', 'https://')
     end
 
     def mark_verified!