|
@@ -100,11 +100,6 @@ class Zend_Serializer_Adapter_PythonPickle extends Zend_Serializer_Adapter_Adapt
|
|
|
const OP_SHORT_BINBYTES = 'C'; // " " ; " " " " < 256 bytes
|
|
const OP_SHORT_BINBYTES = 'C'; // " " ; " " " " < 256 bytes
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @var bool Whether or not this is a PHP 6 binary
|
|
|
|
|
- */
|
|
|
|
|
- protected static $_isPhp6 = null;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
* @var bool Whether or not the system is little-endian
|
|
* @var bool Whether or not the system is little-endian
|
|
|
*/
|
|
*/
|
|
|
protected static $_isLittleEndian = null;
|
|
protected static $_isLittleEndian = null;
|
|
@@ -155,9 +150,6 @@ class Zend_Serializer_Adapter_PythonPickle extends Zend_Serializer_Adapter_Adapt
|
|
|
if (self::$_isLittleEndian === null) {
|
|
if (self::$_isLittleEndian === null) {
|
|
|
self::$_isLittleEndian = (pack('l', 1) === "\x01\x00\x00\x00");
|
|
self::$_isLittleEndian = (pack('l', 1) === "\x01\x00\x00\x00");
|
|
|
}
|
|
}
|
|
|
- if (self::$_isPhp6 === null) {
|
|
|
|
|
- self::$_isPhp6 = !version_compare(PHP_VERSION, '6.0.0', '<');
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
$this->_marker = new stdClass();
|
|
$this->_marker = new stdClass();
|
|
|
}
|
|
}
|
|
@@ -1103,10 +1095,6 @@ class Zend_Serializer_Adapter_PythonPickle extends Zend_Serializer_Adapter_Adapt
|
|
|
$pattern = '/\\\\u([a-fA-F0-9]{4})/u'; // \uXXXX
|
|
$pattern = '/\\\\u([a-fA-F0-9]{4})/u'; // \uXXXX
|
|
|
$data = preg_replace_callback($pattern, array($this, '_convertMatchingUnicodeSequence2Utf8'), $data);
|
|
$data = preg_replace_callback($pattern, array($this, '_convertMatchingUnicodeSequence2Utf8'), $data);
|
|
|
|
|
|
|
|
- if (self::$_isPhp6) {
|
|
|
|
|
- $data = unicode_decode($data, 'UTF-8');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
$this->_stack[] = $data;
|
|
$this->_stack[] = $data;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1172,10 +1160,6 @@ class Zend_Serializer_Adapter_PythonPickle extends Zend_Serializer_Adapter_Adapt
|
|
|
list(, $n) = unpack('l', $n);
|
|
list(, $n) = unpack('l', $n);
|
|
|
$data = $this->_read($n);
|
|
$data = $this->_read($n);
|
|
|
|
|
|
|
|
- if (self::$_isPhp6) {
|
|
|
|
|
- $data = unicode_decode($data, 'UTF-8');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
$this->_stack[] = $data;
|
|
$this->_stack[] = $data;
|
|
|
}
|
|
}
|
|
|
|
|
|