Lib_Unserialize - Version 1.9.3.0

Version Notes

1.9.3.0

Download this release

Release Info

Developer Magento Core Team
Extension Lib_Unserialize
Version 1.9.3.0
Comparing to
See all releases


Code changes from version 1.9.2.4 to 1.9.3.0

lib/Unserialize/Parser.php CHANGED
@@ -34,6 +34,7 @@ class Unserialize_Parser
34
const TYPE_DOUBLE = 'd';
35
const TYPE_ARRAY = 'a';
36
const TYPE_BOOL = 'b';
37
38
const SYMBOL_QUOTE = '"';
39
const SYMBOL_SEMICOLON = ';';
34
const TYPE_DOUBLE = 'd';
35
const TYPE_ARRAY = 'a';
36
const TYPE_BOOL = 'b';
37
+ const TYPE_NULL = 'N';
38
39
const SYMBOL_QUOTE = '"';
40
const SYMBOL_SEMICOLON = ';';
lib/Unserialize/Reader/Arr.php CHANGED
@@ -101,7 +101,10 @@ class Unserialize_Reader_Arr
101
if ($this->_status == self::READING_VALUE) {
102
$value = $this->_reader->read($char, $prevChar);
103
if (!is_null($value)) {
104
- $this->_result[$this->_reader->key] = $value;
105
if (count($this->_result) < $this->_length) {
106
$this->_reader = new Unserialize_Reader_ArrKey();
107
$this->_status = self::READING_KEY;
101
if ($this->_status == self::READING_VALUE) {
102
$value = $this->_reader->read($char, $prevChar);
103
if (!is_null($value)) {
104
+ $this->_result[$this->_reader->key] =
105
+ ($value == Unserialize_Reader_Null::NULL_VALUE && $prevChar == Unserialize_Parser::TYPE_NULL)
106
+ ? null
107
+ : $value;
108
if (count($this->_result) < $this->_length) {
109
$this->_reader = new Unserialize_Reader_ArrKey();
110
$this->_status = self::READING_KEY;
lib/Unserialize/Reader/ArrValue.php CHANGED
@@ -84,6 +84,10 @@ class Unserialize_Reader_ArrValue
84
$this->_reader = new Unserialize_Reader_Dbl();
85
$this->_status = self::READING_VALUE;
86
break;
87
default:
88
throw new Exception('Unsupported data type ' . $char);
89
}
84
$this->_reader = new Unserialize_Reader_Dbl();
85
$this->_status = self::READING_VALUE;
86
break;
87
+ case Unserialize_Parser::TYPE_NULL:
88
+ $this->_reader = new Unserialize_Reader_Null();
89
+ $this->_status = self::READING_VALUE;
90
+ break;
91
default:
92
throw new Exception('Unsupported data type ' . $char);
93
}
lib/Unserialize/Reader/Null.php ADDED
@@ -0,0 +1,64 @@
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to license@magento.com so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
18
+ * versions in the future. If you wish to customize Magento for your
19
+ * needs please refer to http://www.magento.com for more information.
20
+ *
21
+ * @category Unserialize
22
+ * @package Unserialize_Reader
23
+ * @copyright Copyright (c) 2006-2016 X.commerce, Inc. and affiliates (http://www.magento.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Class Unserialize_Reader_Null
29
+ */
30
+ class Unserialize_Reader_Null
31
+ {
32
+ /**
33
+ * @var int
34
+ */
35
+ protected $_status;
36
+
37
+ /**
38
+ * @var string
39
+ */
40
+ protected $_value;
41
+
42
+ const NULL_VALUE = 'null';
43
+
44
+ const READING_VALUE = 1;
45
+
46
+ /**
47
+ * @param string $char
48
+ * @param string $prevChar
49
+ * @return string|null
50
+ */
51
+ public function read($char, $prevChar)
52
+ {
53
+ if ($prevChar == Unserialize_Parser::SYMBOL_SEMICOLON) {
54
+ $this->_value = self::NULL_VALUE;
55
+ $this->_status = self::READING_VALUE;
56
+ return null;
57
+ }
58
+
59
+ if ($this->_status == self::READING_VALUE && $char == Unserialize_Parser::SYMBOL_SEMICOLON) {
60
+ return $this->_value;
61
+ }
62
+ return null;
63
+ }
64
+ }
package.xml CHANGED
@@ -1,18 +1,18 @@
1
<?xml version="1.0"?>
2
<package>
3
<name>Lib_Unserialize</name>
4
- <version>1.9.2.4</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">Magento Core Edition</license>
7
<channel>community</channel>
8
<extends/>
9
<summary>Magento Library</summary>
10
<description>Magento Library</description>
11
- <notes>1.9.2.4</notes>
12
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
13
- <date>2016-02-17</date>
14
- <time>18:27:30</time>
15
- <contents><target name="magelib"><dir name="Unserialize"><file name="Parser.php" hash="1f2d4c7413f38079b8b1d17ae12ae3f6"/><dir name="Reader"><file name="Arr.php" hash="abea9745fea475b7ec9b870eba385f99"/><file name="ArrKey.php" hash="664103399f7a8b8c98e9a81730cf76ce"/><file name="ArrValue.php" hash="e7fb16422bb937bf64c4b2bd9d843f31"/><file name="Bool.php" hash="2e4b132fdf9ca60006f992aa97daf29c"/><file name="Dbl.php" hash="da65adeacf3fd750cb79bb31ced487df"/><file name="Int.php" hash="06a895c579ec5583a7c709adb371eea1"/><file name="Str.php" hash="602abb0701f2c997d2d06aedbe764e0f"/></dir></dir></target></contents>
16
<compatible/>
17
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
</package>
1
<?xml version="1.0"?>
2
<package>
3
<name>Lib_Unserialize</name>
4
+ <version>1.9.3.0</version>
5
<stability>stable</stability>
6
<license uri="http://opensource.org/licenses/osl-3.0.php">Magento Core Edition</license>
7
<channel>community</channel>
8
<extends/>
9
<summary>Magento Library</summary>
10
<description>Magento Library</description>
11
+ <notes>1.9.3.0</notes>
12
<authors><author><name>Magento Core Team</name><user>core</user><email>core@magentocommerce.com</email></author></authors>
13
+ <date>2016-10-04</date>
14
+ <time>13:04:32</time>
15
+ <contents><target name="magelib"><dir name="Unserialize"><file name="Parser.php" hash="f358068a2b1785779373e3df1bad058a"/><dir name="Reader"><file name="Arr.php" hash="bad7c86cd65dcdcd1cf4dfe19e306ab5"/><file name="ArrKey.php" hash="664103399f7a8b8c98e9a81730cf76ce"/><file name="ArrValue.php" hash="6b7e73e2c57d4bd94649e84e332f3836"/><file name="Bool.php" hash="2e4b132fdf9ca60006f992aa97daf29c"/><file name="Dbl.php" hash="da65adeacf3fd750cb79bb31ced487df"/><file name="Int.php" hash="06a895c579ec5583a7c709adb371eea1"/><file name="Null.php" hash="03717def599b5155db54632d9aa3dd79"/><file name="Str.php" hash="602abb0701f2c997d2d06aedbe764e0f"/></dir></dir></target></contents>
16
<compatible/>
17
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
</package>