liquid 5.7.2 → 5.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eedf7295997cbab7b8d526eb516c8c34aa4a73c8b943d69ee4363cb1684a9d12
4
- data.tar.gz: 335b1d05b70f581e05730e6a21f71a22a83283ac6135e4f29dbab962063e9e90
3
+ metadata.gz: 914cff799e3bd2ac8b59184ae521d8b8eccce15ee3d0dac103e471bcab5f1255
4
+ data.tar.gz: 38b104ec712e953540ab7316ce2e4cfac13a5964f5bc32ca39bc1252b908ac43
5
5
  SHA512:
6
- metadata.gz: e62a54477a5e5c1baba527b412d5009e892bf082c085de5416a88073fffc488576d6842615b1f7f7332d2bd02ccb1ff73bb3e2add22ec57be732d74e5178b389
7
- data.tar.gz: aacf9a3490e2739a7a2ff738fee2d610dd833c5a2a763830c63de2972420687bb4989934d438ee4635d6251b1c0d8ac9eeb4a28a358255b7eeef40b49e30c340
6
+ metadata.gz: f7c7f4e17b845a60ef8d7e2bf21b5378f5c116806ca62bb5f310b595275b3080294e378ea57bf2d70f35809ff4570142ccc77a62f0ac1c0afdd629ae6b1a5980
7
+ data.tar.gz: 48b4101e4e4c293ae10ef34ef701c8fcc3bbf764a55eca7b5a1022b95fa8f7e64d13f1e7ecc9cae5f456c12f30de9172baed90016de088384ec6847950a711b4
data/History.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Liquid Change Log
2
2
 
3
- ## 5.8.0 (unreleased)
3
+ ## 5.7.3 (unreleased)
4
+
5
+ * Raise Liquid::SyntaxError when parsing invalidly encoded strings
4
6
 
5
7
  ## 5.7.2 2025-01-31
6
8
 
data/lib/liquid/lexer.rb CHANGED
@@ -161,6 +161,12 @@ module Liquid
161
161
  end
162
162
  # rubocop:enable Metrics/BlockNesting
163
163
  output << EOS
164
+ rescue ::ArgumentError => e
165
+ if e.message == "invalid byte sequence in #{ss.string.encoding}"
166
+ raise SyntaxError, "Invalid byte sequence in #{ss.string.encoding}"
167
+ else
168
+ raise
169
+ end
164
170
  end
165
171
 
166
172
  def raise_syntax_error(start_pos, ss)
@@ -456,7 +456,7 @@ module Liquid
456
456
  # Tests if any item in an array has a specific property value.
457
457
  # @liquid_description
458
458
  # This requires you to provide both the property name and the associated value.
459
- # @liquid_syntax array | some: string, string
459
+ # @liquid_syntax array | has: string, string
460
460
  # @liquid_return [boolean]
461
461
  def has(input, property, target_value = nil)
462
462
  filter_array(input, property, target_value, false) { |ary, &block| ary.any?(&block) }
@@ -103,6 +103,12 @@ module Liquid
103
103
 
104
104
  pos = @ss.pos -= 2
105
105
  @source.byteslice(start, pos - start)
106
+ rescue ::ArgumentError => e
107
+ if e.message == "invalid byte sequence in #{@ss.string.encoding}"
108
+ raise SyntaxError, "Invalid byte sequence in #{@ss.string.encoding}"
109
+ else
110
+ raise
111
+ end
106
112
  end
107
113
 
108
114
  def next_variable_token
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Liquid
5
- VERSION = "5.7.2"
5
+ VERSION = "5.7.3"
6
6
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.7.2
4
+ version: 5.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Lütke
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-31 00:00:00.000000000 Z
10
+ date: 2025-02-24 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: strscan