hanami-view 3.0.2 → 3.0.3
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 +4 -4
- data/CHANGELOG.md +10 -3
- data/lib/hanami/view/helpers/escape_helper.rb +9 -2
- data/lib/hanami/view/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e17bf2dc1636043ee52953cc6d8e15bc68d728aa24f4fd7a1bf210ab48c261f
|
|
4
|
+
data.tar.gz: ace23a06ebffa95b535d89c0f2a1dec222cc1b204d34efe8a3a40e5c94329270
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 436553597576e12218db803ffcb649f2e5189ac49363f2be69e8c0a36c4e34f5e808ae677ed37564784b5bf54d10382880265b2eb1faf9dc804f34c119946394
|
|
7
|
+
data.tar.gz: bcbdfaf11b26fc9c915a02988927ceddc76e3ae1908de79dd9d5a7166476bfeb01940711f98dfeab6803d4974b6d9d7ef15e40292631ce2784e8fe2710eb988c
|
data/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Break Versioning](https://www.taoensso.com/break-versioning).
|
|
7
6
|
|
|
8
7
|
## [Unreleased]
|
|
9
8
|
|
|
@@ -19,7 +18,15 @@ and this project adheres to [Break Versioning](https://www.taoensso.com/break-ve
|
|
|
19
18
|
|
|
20
19
|
### Security
|
|
21
20
|
|
|
22
|
-
[Unreleased]: https://github.com/hanami/view/compare/v3.0.
|
|
21
|
+
[Unreleased]: https://github.com/hanami/view/compare/v3.0.3...HEAD
|
|
22
|
+
|
|
23
|
+
## [3.0.3] - 2026-11-24
|
|
24
|
+
|
|
25
|
+
### Security
|
|
26
|
+
|
|
27
|
+
- Percent-encode quotes, backticks, angle brackets and spaces in the result of `sanitize_url`. Previously a decoded `'` was returned as-is in an HTML-safe string, breaking out of single-quoted attributes. (@parndt in GHSA-4g74-pv6p-g8hw)
|
|
28
|
+
|
|
29
|
+
[3.0.3]: https://github.com/hanami/view/compare/v3.0.2...v3.0.3
|
|
23
30
|
|
|
24
31
|
## [3.0.2] - 2026-08-21
|
|
25
32
|
|
|
@@ -120,12 +120,19 @@ module Hanami
|
|
|
120
120
|
def sanitize_url(input, permitted_schemes = PERMITTED_URL_SCHEMES)
|
|
121
121
|
return input if input.html_safe?
|
|
122
122
|
|
|
123
|
-
URI_PARSER.extract(
|
|
123
|
+
url = URI_PARSER.extract(
|
|
124
124
|
URI.decode_www_form_component(input.to_s),
|
|
125
125
|
permitted_schemes
|
|
126
|
-
).first.to_s
|
|
126
|
+
).first.to_s
|
|
127
|
+
|
|
128
|
+
# Percent-encode characters that can end an HTML attribute. None of them may appear
|
|
129
|
+
# unencoded in a valid URI, so well-formed URLs are unchanged.
|
|
130
|
+
url.gsub(UNSAFE_URL_CHARS) { |char| format("%%%02X", char.ord) }.html_safe
|
|
127
131
|
end
|
|
128
132
|
|
|
133
|
+
UNSAFE_URL_CHARS = /['"`<> ]/
|
|
134
|
+
private_constant :UNSAFE_URL_CHARS
|
|
135
|
+
|
|
129
136
|
# Use the RFC2396_PARSER if available. Modern Rubies should have RFC2396_PARSER available.
|
|
130
137
|
# Otherwise, fall back to the DEFAULT_PARSER (which may still raise deprecation warnings).
|
|
131
138
|
#
|
data/lib/hanami/view/version.rb
CHANGED