solidus_core 3.1.1 → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84e6a49d44adf0951d9e774b0e212f39841ca0183827e5ec902d5dfb13f27cf2
4
- data.tar.gz: 1d7e7b23b450a781782ac2259ccd50aa54b455c7b07e90070a2c39ff3320b640
3
+ metadata.gz: 924090a77efc768ede5475d819872ed30b02cb7990e87d3fdd5877b58b8e7fac
4
+ data.tar.gz: 1eeee8182a6f5ade835a347711a9c74b3b29e201bfe93c7fef7c710e6b62b6a1
5
5
  SHA512:
6
- metadata.gz: f5caeff8f63a04cc9df497e06e3f782a0f6ff994464b98e5d9f1db58e3cf1149b1a02cf2dd707c4bb5291aad76ff91682df6797fcb56fd87522cda874bbcd0a2
7
- data.tar.gz: 6150acbad591a8bc78d2283dd253deb1c5f47470194117a016d72e32cf633a5e9e56dbf7343d87fd0ffdef8cef4f7ea588ef45481acb918010fe4c2e647bee96
6
+ metadata.gz: 8b6f4995130898a6874b22b97d390b89fa51be305b0d2fcd223c2ee8db2263a30ff599e5109e6eb2e58da33ef2c9014a7f8c980764914d30325997bddc36759d
7
+ data.tar.gz: eaba68996368d1569f7e76c348c2126eeedc0fb29cf0378056d6f9e340e0937004661f7a0994284db40e38e5234174d34552700b2a57806fd713fc436dae1938
@@ -67,6 +67,14 @@ module Spree
67
67
  config.after_initialize do
68
68
  Spree::Config.check_load_defaults_called('Spree::Config')
69
69
  end
70
+
71
+ config.after_initialize do
72
+ if defined?(Spree::Auth::Engine) &&
73
+ Gem::Version.new(Spree::Auth::VERSION) < Gem::Version.new('2.5.4') &&
74
+ defined?(Spree::UsersController)
75
+ Spree::UsersController.protect_from_forgery with: :exception
76
+ end
77
+ end
70
78
  end
71
79
  end
72
80
  end
@@ -12,7 +12,7 @@ module Spree
12
12
  # end
13
13
  #
14
14
  class EmailValidator < ActiveModel::EachValidator
15
- EMAIL_REGEXP = /\A([^@\.]|[^@\.]([^@\s]*)[^@\.])@([^@\s]+\.)+[^@\s]+\z/
15
+ EMAIL_REGEXP = URI::MailTo::EMAIL_REGEXP
16
16
 
17
17
  def validate_each(record, attribute, value)
18
18
  unless EMAIL_REGEXP.match? value
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spree
4
- VERSION = "3.1.1"
4
+ VERSION = "3.1.5"
5
5
 
6
6
  def self.solidus_version
7
7
  VERSION
data/lib/spree/core.rb CHANGED
@@ -62,13 +62,24 @@ module Spree
62
62
  end
63
63
 
64
64
  module Core
65
- def self.has_install_generator_been_run?
66
- (Rails.env.test? && Rails.application.class.name == 'DummyApp::Application') ||
67
- Rails.application.paths['config/initializers'].paths.any? do |path|
68
- File.exist?(path.join('spree.rb'))
69
- end
65
+ # @api private
66
+ def self.has_install_generator_been_run?(rails_paths: Rails.application.paths, initializer_name: 'spree.rb', dummy_app_name: 'DummyApp::Application')
67
+ does_spree_initializer_exist?(rails_paths, initializer_name) ||
68
+ running_solidus_test_suite_with_dummy_app?(dummy_app_name)
70
69
  end
71
70
 
71
+ def self.running_solidus_test_suite_with_dummy_app?(dummy_app_name)
72
+ Rails.env.test? && Rails.application.class.name == dummy_app_name
73
+ end
74
+ private_class_method :running_solidus_test_suite_with_dummy_app?
75
+
76
+ def self.does_spree_initializer_exist?(rails_paths, initializer_name)
77
+ rails_paths['config/initializers'].any? do |path|
78
+ File.exist?(Pathname.new(path).join(initializer_name))
79
+ end
80
+ end
81
+ private_class_method :does_spree_initializer_exist?
82
+
72
83
  class GatewayError < RuntimeError; end
73
84
  end
74
85
  end
@@ -5,7 +5,7 @@ module Spree
5
5
  module BlacklistUrls
6
6
  def setup_url_blacklist(browser)
7
7
  if browser.respond_to?(:url_blacklist)
8
- browser.url_blacklist = ['http://fonts.googleapis.com']
8
+ browser.url_blacklist = ['https://fonts.googleapis.com']
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ namespace :solidus do
4
+ desc 'Prints orders with invalid email (after fix for GHSA-qxmr-qxh6-2cc9)'
5
+ task check_orders_with_invalid_email: :environment do
6
+ matches = Spree::Order.find_each.reduce([]) do |matches, order|
7
+ order.email.nil? || Spree::EmailValidator::EMAIL_REGEXP.match?(order.email) ? matches : matches + [order]
8
+ end
9
+ if matches.any?
10
+ puts 'Email / ID / Number'
11
+ puts(matches.map do |order|
12
+ "#{order.email} / #{order.id} / #{order.number}"
13
+ end.join("\n"))
14
+ else
15
+ puts 'NO MATCHES'
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-20 00:00:00.000000000 Z
11
+ date: 2021-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer
@@ -907,6 +907,7 @@ files:
907
907
  - lib/spree/testing_support/url_helpers.rb
908
908
  - lib/spree/user_class_handle.rb
909
909
  - lib/spree_core.rb
910
+ - lib/tasks/solidus/check_orders_with_invalid_email.rake
910
911
  - lib/tasks/solidus/delete_prices_with_nil_amount.rake
911
912
  - solidus_core.gemspec
912
913
  - vendor/assets/javascripts/jquery.payment.js
@@ -953,8 +954,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
953
954
  - !ruby/object:Gem::Version
954
955
  version: 1.8.23
955
956
  requirements: []
956
- rubygems_version: 3.2.20
957
- signing_key:
957
+ rubygems_version: 3.1.2
958
+ signing_key:
958
959
  specification_version: 4
959
960
  summary: Essential models, mailers, and classes for the Solidus e-commerce project.
960
961
  test_files: []