mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.1' into PHP-7.2
This commit is contained in:
commit
aa925cb0ad
3 changed files with 62 additions and 2 deletions
4
NEWS
4
NEWS
|
@ -12,6 +12,10 @@ PHP NEWS
|
||||||
- SPL:
|
- SPL:
|
||||||
. Added spl_object_id(). (Tyson Andre)
|
. Added spl_object_id(). (Tyson Andre)
|
||||||
|
|
||||||
|
- XMLRPC:
|
||||||
|
. Fixed bug #74975 (Incorrect xmlrpc serialization for classes with declared
|
||||||
|
properties). (blar)
|
||||||
|
|
||||||
03 Aug 2017, PHP 7.2.0beta2
|
03 Aug 2017, PHP 7.2.0beta2
|
||||||
|
|
||||||
- Core:
|
- Core:
|
||||||
|
|
56
ext/xmlrpc/tests/bug74975.phpt
Normal file
56
ext/xmlrpc/tests/bug74975.phpt
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #74975 Different serialization for classes
|
||||||
|
--SKIPIF--
|
||||||
|
<?php
|
||||||
|
if (!extension_loaded("xmlrpc")) print "skip";
|
||||||
|
?>
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Bar {
|
||||||
|
|
||||||
|
public $xmlrpc_type;
|
||||||
|
public $scalar;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$foo = new Foo();
|
||||||
|
$foo->xmlrpc_type = 'base64';
|
||||||
|
$foo->scalar = 'foobar';
|
||||||
|
|
||||||
|
$bar = new Bar();
|
||||||
|
$bar->xmlrpc_type = 'base64';
|
||||||
|
$bar->scalar = 'foobar';
|
||||||
|
|
||||||
|
echo xmlrpc_encode([
|
||||||
|
'foo' => $foo,
|
||||||
|
'bar' => $bar
|
||||||
|
]);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<params>
|
||||||
|
<param>
|
||||||
|
<value>
|
||||||
|
<struct>
|
||||||
|
<member>
|
||||||
|
<name>foo</name>
|
||||||
|
<value>
|
||||||
|
<base64>Zm9vYmFy </base64>
|
||||||
|
</value>
|
||||||
|
</member>
|
||||||
|
<member>
|
||||||
|
<name>bar</name>
|
||||||
|
<value>
|
||||||
|
<base64>Zm9vYmFy </base64>
|
||||||
|
</value>
|
||||||
|
</member>
|
||||||
|
</struct>
|
||||||
|
</value>
|
||||||
|
</param>
|
||||||
|
</params>
|
|
@ -1354,7 +1354,7 @@ XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval* newvalue) /* {{{ */
|
||||||
zval* attr;
|
zval* attr;
|
||||||
type = xmlrpc_vector;
|
type = xmlrpc_vector;
|
||||||
|
|
||||||
if ((attr = zend_hash_str_find(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR) - 1)) != NULL) {
|
if ((attr = zend_hash_str_find_ind(Z_OBJPROP_P(value), OBJECT_TYPE_ATTR, sizeof(OBJECT_TYPE_ATTR) - 1)) != NULL) {
|
||||||
if (Z_TYPE_P(attr) == IS_STRING) {
|
if (Z_TYPE_P(attr) == IS_STRING) {
|
||||||
type = xmlrpc_str_as_type(Z_STRVAL_P(attr));
|
type = xmlrpc_str_as_type(Z_STRVAL_P(attr));
|
||||||
}
|
}
|
||||||
|
@ -1368,7 +1368,7 @@ XMLRPC_VALUE_TYPE get_zval_xmlrpc_type(zval* value, zval* newvalue) /* {{{ */
|
||||||
zval* val;
|
zval* val;
|
||||||
|
|
||||||
if ((type == xmlrpc_base64 && Z_TYPE_P(value) == IS_OBJECT) || type == xmlrpc_datetime) {
|
if ((type == xmlrpc_base64 && Z_TYPE_P(value) == IS_OBJECT) || type == xmlrpc_datetime) {
|
||||||
if ((val = zend_hash_str_find(Z_OBJPROP_P(value), OBJECT_VALUE_ATTR, sizeof(OBJECT_VALUE_ATTR) - 1)) != NULL) {
|
if ((val = zend_hash_str_find_ind(Z_OBJPROP_P(value), OBJECT_VALUE_ATTR, sizeof(OBJECT_VALUE_ATTR) - 1)) != NULL) {
|
||||||
ZVAL_COPY_VALUE(newvalue, val);
|
ZVAL_COPY_VALUE(newvalue, val);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue