php-serialize 1.4.0 → 1.4.1
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/lib/php_serialize.rb +1 -1
- data/test/php_serialize_test.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0591bd5488ad85fe41df67a598114a16443c7ff275d3ccbaeadc1a02e2a8868b'
|
4
|
+
data.tar.gz: afa368fe56e55dec820f09925910a447e01e51fe791ddee35d55fd4421b441d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/test/php_serialize_test.rb
CHANGED
@@ -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.
|
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
|
11
|
+
date: 2024-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|