actionview 6.1.4.7 → 6.1.5

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

Potentially problematic release.


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

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf58155de1e409e70c9b1f2eea25bf7bc209f8c4274aa7eb4a71aa300b67d2e3
4
- data.tar.gz: 7032037d2fec8c65f3002a47b86095a9b1cdd44f8cbb8b58a4546eda5d751cda
3
+ metadata.gz: fd064a197a833619a7f7946467645cf6814026fc955611621b69bdf46e84999d
4
+ data.tar.gz: decb0c47e2ddab1aabb45bd2a0e4001296c59d680cedc84f153e4340b4872040
5
5
  SHA512:
6
- metadata.gz: 05f2f45f473cddd4968d4099f3e742129da27ce25e411eed08d4e99e7cba7e7136d067633b90c316676d6e32f48fe54bc5b2e5d36b980359a457489903a42fd9
7
- data.tar.gz: 015e339274ee65a6a1fc00aae69c82a885f72a081e8140748677bbb8b9e797048a6e135594ae25d446779425a02851bea1a2dfe6c865ff6cf2d85d473d4b0068
6
+ metadata.gz: 4cce01bf7d01ed74cdeed1e68ecfa02c8bb714e6ae2737ff8b413a2d1dfd28d218dc0652561851ad8753214968ce29ecf0b7aadf7f6cd06e301e3ee975e4b454
7
+ data.tar.gz: a2103caa32e76b4cdb7f1efb56bf36388374bdaf9acde4874c8578482024a5945329d194d762bdfd6803b53713356284216a9d15795c56ad203ce5ed16410271
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## Rails 6.1.5 (March 09, 2022) ##
2
+
3
+ * `preload_link_tag` properly inserts `as` attributes for files with `image` MIME
4
+ types, such as JPG or SVG.
5
+
6
+ *Nate Berkopec*
7
+
8
+ * Add `autocomplete="off"` to all generated hidden fields.
9
+
10
+ Fixes #42610.
11
+
12
+ *Ryan Baumann*
13
+
14
+ * Fix `current_page?` when URL has trailing slash.
15
+
16
+ This fixes the `current_page?` helper when the given URL has a trailing slash,
17
+ and is an absolute URL or also has query params.
18
+
19
+ Fixes #33956.
20
+
21
+ *Jonathan Hefner*
22
+
23
+
1
24
  ## Rails 6.1.4.7 (March 08, 2022) ##
2
25
 
3
26
  * No changes.
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2004-2020 David Heinemeier Hansson
1
+ Copyright (c) 2004-2022 David Heinemeier Hansson
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -18,4 +18,3 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
20
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
-
@@ -9,8 +9,8 @@ module ActionView
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 4
13
- PRE = "7"
12
+ TINY = 5
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -509,7 +509,7 @@ module ActionView
509
509
  "style"
510
510
  elsif extname == "vtt"
511
511
  "track"
512
- elsif (type = mime_type.to_s.split("/")[0]) && type.in?(%w(audio video font))
512
+ elsif (type = mime_type.to_s.split("/")[0]) && type.in?(%w(audio video font image))
513
513
  type
514
514
  end
515
515
  end
@@ -1101,7 +1101,8 @@ module ActionView
1101
1101
  type: "hidden",
1102
1102
  id: input_id_from_type(type),
1103
1103
  name: input_name_from_type(type),
1104
- value: value
1104
+ value: value,
1105
+ autocomplete: "off"
1105
1106
  }.merge!(@html_options.slice(:disabled))
1106
1107
  select_options[:disabled] = "disabled" if @options[:disabled]
1107
1108
 
@@ -241,7 +241,7 @@ module ActionView
241
241
  # # => <input id="collected_input" name="collected_input" onchange="alert('Input collected!')"
242
242
  # # type="hidden" value="" />
243
243
  def hidden_field_tag(name, value = nil, options = {})
244
- text_field_tag(name, value, options.merge(type: :hidden))
244
+ text_field_tag(name, value, options.merge(type: :hidden, autocomplete: "off"))
245
245
  end
246
246
 
247
247
  # Creates a file upload field. If you are using file uploads then you will also need
@@ -823,7 +823,7 @@ module ActionView
823
823
  # Use raw HTML to ensure the value is written as an HTML entity; it
824
824
  # needs to be the right character regardless of which encoding the
825
825
  # browser infers.
826
- '<input name="utf8" type="hidden" value="&#x2713;" />'.html_safe
826
+ '<input name="utf8" type="hidden" value="&#x2713;" autocomplete="off" />'.html_safe
827
827
  end
828
828
 
829
829
  private
@@ -153,7 +153,7 @@ module ActionView
153
153
  select = content_tag("select", add_options(option_tags, options, value), html_options)
154
154
 
155
155
  if html_options["multiple"] && options.fetch(:include_hidden, true)
156
- tag("input", disabled: html_options["disabled"], name: html_options["name"], type: "hidden", value: "") + select
156
+ tag("input", disabled: html_options["disabled"], name: html_options["name"], type: "hidden", value: "", autocomplete: "off") + select
157
157
  else
158
158
  select
159
159
  end
@@ -57,7 +57,7 @@ module ActionView
57
57
  end
58
58
 
59
59
  def hidden_field_for_checkbox(options)
60
- @unchecked_value ? tag("input", options.slice("name", "disabled", "form").merge!("type" => "hidden", "value" => @unchecked_value)) : "".html_safe
60
+ @unchecked_value ? tag("input", options.slice("name", "disabled", "form").merge!("type" => "hidden", "value" => @unchecked_value, "autocomplete" => "off")) : "".html_safe
61
61
  end
62
62
  end
63
63
  end
@@ -4,6 +4,10 @@ module ActionView
4
4
  module Helpers
5
5
  module Tags # :nodoc:
6
6
  class HiddenField < TextField # :nodoc:
7
+ def render
8
+ @options[:autocomplete] = "off"
9
+ super
10
+ end
7
11
  end
8
12
  end
9
13
  end
@@ -337,7 +337,8 @@ module ActionView
337
337
  inner_tags = method_tag.safe_concat(button).safe_concat(request_token_tag)
338
338
  if params
339
339
  to_form_params(params).each do |param|
340
- inner_tags.safe_concat tag(:input, type: "hidden", name: param[:name], value: param[:value])
340
+ inner_tags.safe_concat tag(:input, type: "hidden", name: param[:name], value: param[:value],
341
+ autocomplete: "off")
341
342
  end
342
343
  end
343
344
  content_tag("form", inner_tags, form_options)
@@ -559,16 +560,14 @@ module ActionView
559
560
  request_uri = url_string.index("?") || check_parameters ? request.fullpath : request.path
560
561
  request_uri = URI::DEFAULT_PARSER.unescape(request_uri).force_encoding(Encoding::BINARY)
561
562
 
562
- if url_string.start_with?("/") && url_string != "/"
563
- url_string.chomp!("/")
564
- request_uri.chomp!("/")
565
- end
566
-
567
563
  if %r{^\w+://}.match?(url_string)
568
- url_string == "#{request.protocol}#{request.host_with_port}#{request_uri}"
569
- else
570
- url_string == request_uri
564
+ request_uri = +"#{request.protocol}#{request.host_with_port}#{request_uri}"
571
565
  end
566
+
567
+ remove_trailing_slash!(url_string)
568
+ remove_trailing_slash!(request_uri)
569
+
570
+ url_string == request_uri
572
571
  end
573
572
 
574
573
  if RUBY_VERSION.start_with?("2.7")
@@ -728,14 +727,14 @@ module ActionView
728
727
  def token_tag(token = nil, form_options: {})
729
728
  if token != false && defined?(protect_against_forgery?) && protect_against_forgery?
730
729
  token ||= form_authenticity_token(form_options: form_options)
731
- tag(:input, type: "hidden", name: request_forgery_protection_token.to_s, value: token)
730
+ tag(:input, type: "hidden", name: request_forgery_protection_token.to_s, value: token, autocomplete: "off")
732
731
  else
733
732
  ""
734
733
  end
735
734
  end
736
735
 
737
736
  def method_tag(method)
738
- tag("input", type: "hidden", name: "_method", value: method.to_s)
737
+ tag("input", type: "hidden", name: "_method", value: method.to_s, autocomplete: "off")
739
738
  end
740
739
 
741
740
  # Returns an array of hashes each containing :name and :value keys
@@ -779,6 +778,11 @@ module ActionView
779
778
 
780
779
  params.sort_by { |pair| pair[:name] }
781
780
  end
781
+
782
+ def remove_trailing_slash!(url_string)
783
+ trailing_index = (url_string.index("?") || 0) - 1
784
+ url_string[trailing_index] = "" if url_string[trailing_index] == "/"
785
+ end
782
786
  end
783
787
  end
784
788
  end
@@ -46,7 +46,7 @@ module ActionView
46
46
  app.config.action_view.each do |k, v|
47
47
  if k == :raise_on_missing_translations
48
48
  ActiveSupport::Deprecation.warn \
49
- "action_view.raise_on_missing_translations is deprecated and will be removed in Rails 6.2. " \
49
+ "action_view.raise_on_missing_translations is deprecated and will be removed in Rails 7.0. " \
50
50
  "Set i18n.raise_on_missing_translations instead. " \
51
51
  "Note that this new setting also affects how missing translations are handled in controllers."
52
52
  end
data/lib/action_view.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  #--
4
- # Copyright (c) 2004-2020 David Heinemeier Hansson
4
+ # Copyright (c) 2004-2022 David Heinemeier Hansson
5
5
  #
6
6
  # Permission is hereby granted, free of charge, to any person obtaining
7
7
  # a copy of this software and associated documentation files (the
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionview
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.4.7
4
+ version: 6.1.5
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-08 00:00:00.000000000 Z
11
+ date: 2022-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.4.7
19
+ version: 6.1.5
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 6.1.4.7
26
+ version: 6.1.5
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 6.1.4.7
95
+ version: 6.1.5
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 6.1.4.7
102
+ version: 6.1.5
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: activemodel
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 6.1.4.7
109
+ version: 6.1.5
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - '='
115
115
  - !ruby/object:Gem::Version
116
- version: 6.1.4.7
116
+ version: 6.1.5
117
117
  description: Simple, battle-tested conventions and helpers for building web pages.
118
118
  email: david@loudthinking.com
119
119
  executables: []
@@ -239,11 +239,12 @@ licenses:
239
239
  - MIT
240
240
  metadata:
241
241
  bug_tracker_uri: https://github.com/rails/rails/issues
242
- changelog_uri: https://github.com/rails/rails/blob/v6.1.4.7/actionview/CHANGELOG.md
243
- documentation_uri: https://api.rubyonrails.org/v6.1.4.7/
242
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.5/actionview/CHANGELOG.md
243
+ documentation_uri: https://api.rubyonrails.org/v6.1.5/
244
244
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
245
- source_code_uri: https://github.com/rails/rails/tree/v6.1.4.7/actionview
246
- post_install_message:
245
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.5/actionview
246
+ rubygems_mfa_required: 'true'
247
+ post_install_message:
247
248
  rdoc_options: []
248
249
  require_paths:
249
250
  - lib
@@ -259,8 +260,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
259
260
  version: '0'
260
261
  requirements:
261
262
  - none
262
- rubygems_version: 3.1.6
263
- signing_key:
263
+ rubygems_version: 3.3.7
264
+ signing_key:
264
265
  specification_version: 4
265
266
  summary: Rendering framework putting the V in MVC (part of Rails).
266
267
  test_files: []