activesupport 6.1.5 → 6.1.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activesupport might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b3babd75cfe9eba9446aa952df30fa9e7a6b8ace1d63022314a7cd9be07eeb6
4
- data.tar.gz: 16ad9c941a3643fdb30602b5ffea85aedc9306babaaf5caccee7041726df0a89
3
+ metadata.gz: 86fc82a4ac7a8ff4945e8433ea6873e1d9325b470ad7ac8d7310c73370a4f01d
4
+ data.tar.gz: 62f8370923132917f2d665eb09bf1975db08a335d951013cbfaa15077b778d6e
5
5
  SHA512:
6
- metadata.gz: c362a52ce66fc84e04216656f8919cc39e22280fe7a5f2e0daf1f228ee503be30caf7b942bb7c8ca9445f0aed6604cf6cc8d048c9a9cc9154a91f284e17518db
7
- data.tar.gz: bc8e7c37926b6c30b80ae39d22f0c57fb756e1fd8faebdd5047196afe7508b0ff86691c970f0db3c100e741445b76cb1366bda1dda6ecfc9b5a6ea574415e097
6
+ metadata.gz: ac345691c68306eb3fd83090e79e2794de25d1cf8a6caf34199d4bced1a144a11b670e1a1471dbfe6079c6a4acab76d36d9f2aefc05ad5539f180048a45029ad
7
+ data.tar.gz: 0ebb0c6a75f4c1664e673927a50dc3506915f17667bc6768535365b80f1d775f13a07b74150725eb6e24a117deae15566a4d40471bfea2678b11c213503429f1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## Rails 6.1.7 (September 09, 2022) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.6.1 (July 12, 2022) ##
7
+
8
+ * No changes.
9
+
10
+
11
+ ## Rails 6.1.6 (May 09, 2022) ##
12
+
13
+ * No changes.
14
+
15
+
16
+ ## Rails 6.1.5.1 (April 26, 2022) ##
17
+
18
+ * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
19
+
20
+ Add the method `ERB::Util.xml_name_escape` to escape dangerous characters
21
+ in names of tags and names of attributes, following the specification of XML.
22
+
23
+ *Álvaro Martín Fraguas*
24
+
1
25
  ## Rails 6.1.5 (March 09, 2022) ##
2
26
 
3
27
  * Fix `ActiveSupport::Duration.build` to support negative values.
@@ -11,6 +11,14 @@ class ERB
11
11
  HTML_ESCAPE_ONCE_REGEXP = /["><']|&(?!([a-zA-Z]+|(#\d+)|(#[xX][\dA-Fa-f]+));)/
12
12
  JSON_ESCAPE_REGEXP = /[\u2028\u2029&><]/u
13
13
 
14
+ # Following XML requirements: https://www.w3.org/TR/REC-xml/#NT-Name
15
+ TAG_NAME_START_REGEXP_SET = "@:A-Z_a-z\u{C0}-\u{D6}\u{D8}-\u{F6}\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}" \
16
+ "\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}" \
17
+ "\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}"
18
+ TAG_NAME_START_REGEXP = /[^#{TAG_NAME_START_REGEXP_SET}]/
19
+ TAG_NAME_FOLLOWING_REGEXP = /[^#{TAG_NAME_START_REGEXP_SET}\-.0-9\u{B7}\u{0300}-\u{036F}\u{203F}-\u{2040}]/
20
+ TAG_NAME_REPLACEMENT_CHAR = "_"
21
+
14
22
  # A utility method for escaping HTML tag characters.
15
23
  # This method is also aliased as <tt>h</tt>.
16
24
  #
@@ -115,6 +123,26 @@ class ERB
115
123
  end
116
124
 
117
125
  module_function :json_escape
126
+
127
+ # A utility method for escaping XML names of tags and names of attributes.
128
+ #
129
+ # xml_name_escape('1 < 2 & 3')
130
+ # # => "1___2___3"
131
+ #
132
+ # It follows the requirements of the specification: https://www.w3.org/TR/REC-xml/#NT-Name
133
+ def xml_name_escape(name)
134
+ name = name.to_s
135
+ return "" if name.blank?
136
+
137
+ starting_char = name[0].gsub(TAG_NAME_START_REGEXP, TAG_NAME_REPLACEMENT_CHAR)
138
+
139
+ return starting_char if name.size == 1
140
+
141
+ following_chars = name[1..-1].gsub(TAG_NAME_FOLLOWING_REGEXP, TAG_NAME_REPLACEMENT_CHAR)
142
+
143
+ starting_char + following_chars
144
+ end
145
+ module_function :xml_name_escape
118
146
  end
119
147
  end
120
148
 
@@ -164,6 +164,7 @@ module ActiveSupport
164
164
 
165
165
  send(name, *args, &block)
166
166
  end
167
+ ruby2_keywords(:method_missing) if respond_to?(:ruby2_keywords, true)
167
168
  end
168
169
 
169
170
  attr_accessor :attributes
@@ -9,7 +9,7 @@ module ActiveSupport
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 5
12
+ TINY = 7
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.5
4
+ version: 6.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-10 00:00:00.000000000 Z
11
+ date: 2022-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -357,12 +357,12 @@ licenses:
357
357
  - MIT
358
358
  metadata:
359
359
  bug_tracker_uri: https://github.com/rails/rails/issues
360
- changelog_uri: https://github.com/rails/rails/blob/v6.1.5/activesupport/CHANGELOG.md
361
- documentation_uri: https://api.rubyonrails.org/v6.1.5/
360
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.7/activesupport/CHANGELOG.md
361
+ documentation_uri: https://api.rubyonrails.org/v6.1.7/
362
362
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
363
- source_code_uri: https://github.com/rails/rails/tree/v6.1.5/activesupport
363
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.7/activesupport
364
364
  rubygems_mfa_required: 'true'
365
- post_install_message:
365
+ post_install_message:
366
366
  rdoc_options:
367
367
  - "--encoding"
368
368
  - UTF-8
@@ -379,8 +379,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
379
379
  - !ruby/object:Gem::Version
380
380
  version: '0'
381
381
  requirements: []
382
- rubygems_version: 3.3.7
383
- signing_key:
382
+ rubygems_version: 3.3.3
383
+ signing_key:
384
384
  specification_version: 4
385
385
  summary: A toolkit of support libraries and Ruby core extensions extracted from the
386
386
  Rails framework.