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.

Fixed unsafe regexp for Custom Domain validation

Damian Legawiecfd9f71c5652b
diff --git a/core/app/models/spree/custom_domain.rb b/core/app/models/spree/custom_domain.rb
index bb75fb1ced..427aa31972 100644
--- a/core/app/models/spree/custom_domain.rb
+++ b/core/app/models/spree/custom_domain.rb
@@ -14,7 +14,7 @@ module Spree
# Validations
#
validates :url, presence: true, uniqueness: true, format: {
- with: %r{[a-z][a-z0-9-]*[a-z0-9]}i
+ with: %r{\A[a-z][a-z0-9-]*[a-z0-9]\z}i
}, length: { in: 1..63 }
validate :url_is_valid