Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

ADD more protocol to page builder links (#13127)

brozek9ca051883f03
diff --git a/core/app/models/spree/page_link.rb b/core/app/models/spree/page_link.rb
index ceba49e20e..939243f53a 100644
--- a/core/app/models/spree/page_link.rb
+++ b/core/app/models/spree/page_link.rb
@@ -30,7 +30,7 @@ module Spree
def formatted_url
return if url.blank?
- return url if url.start_with?("mailto:")
+ return url if %w[mailto: tel:].any? { |protocol| url.start_with?(protocol) }
@formatted_url ||= url.match(/http:\/\/|https:\/\//) ? url : "http://#{url}"
end