php-serialize 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ad6d644735d6cf8749b281aa1bb0135fd383d69afa7bdcd8474da2080fb35b3
4
- data.tar.gz: 290687c9212981d99039eb169a7cb3dd6817714dc4ac670c11e79485de202b6f
3
+ metadata.gz: '0591bd5488ad85fe41df67a598114a16443c7ff275d3ccbaeadc1a02e2a8868b'
4
+ data.tar.gz: afa368fe56e55dec820f09925910a447e01e51fe791ddee35d55fd4421b441d1
5
5
  SHA512:
6
- metadata.gz: a806b59eeae1a7aeae84d38bad946173eb7245ba5819ab807e7d2fa6543444a90600eec81ba769252389ef16b9d4be213aaf79e484c3880da44c5bd30a2c542d
7
- data.tar.gz: '096e7d3642c2c2eb85a324422f133d40753244d17df87fa84d4d9328b0fb3da1b185af0f0edd9de3282488192bdff29e8bf31e292609c78f44ec6d4c76b52ec9'
6
+ metadata.gz: eec063376173d5b74cda2dd5e46352093973e64f21936f3d3b4d66de532aafe2c4928ab921db008221de178ece92960315418b6b19db8114bfe0a4c4e1c9637e
7
+ data.tar.gz: b9774ec8c8edf352cd12a74142785cdc2804bd19437f586decacbc7f41a72d8cff719c8985978c65c97b3735168ffaee305a7779b9e920ad5dd9819fbb681199
data/lib/php_serialize.rb CHANGED
@@ -164,7 +164,7 @@ module PHP
164
164
 
165
165
  ret = nil
166
166
  original_encoding = string.encoding
167
- string = StringIOReader.new(string.force_encoding('BINARY'))
167
+ string = StringIOReader.new(string.dup.force_encoding('BINARY'))
168
168
  while string.string[string.pos, 32] =~ /^(\w+)\|/ # session_name|serialized_data
169
169
  ret ||= {}
170
170
  string.pos += $&.size
@@ -134,4 +134,14 @@ class TestPhpSerialize < Test::Unit::TestCase
134
134
  PHP.unserialize(phps)
135
135
  end
136
136
  end
137
+
138
+ def test_encoding_kept
139
+ s = String.new('s:3:"abc";', encoding: "ISO-8859-1")
140
+
141
+ assert_equal "ISO-8859-1", s.encoding.name
142
+
143
+ PHP.unserialize(s)
144
+
145
+ assert_equal "ISO-8859-1", s.encoding.name
146
+ end
137
147
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: php-serialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Hurst
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-24 00:00:00.000000000 Z
11
+ date: 2024-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler