Skip to content

Commit 99ab8a8

Browse files
committed
Merge branch 'PHP-5.5' of https://git.php.net/repository/php-src into PHP-5.5
# By Felipe Pena # Via Felipe Pena * 'PHP-5.5' of https://git.php.net/repository/php-src: - Fixed bug #62672 (Error on serialize of ArrayObject) patch by: lior dot k at zend dot com - BFN - Fixed bug #62964 (Possible XSS on "Registered stream filters" info) patch by: david at nnucomputerwhiz dot com
2 parents c3f4cc2 + f5bf90e commit 99ab8a8

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed

ext/spl/spl_array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,7 @@ SPL_METHOD(Array, unserialize)
17661766
++p;
17671767

17681768
if (*p!='m') {
1769-
if (*p!='a' && *p!='O' && *p!='C') {
1769+
if (*p!='a' && *p!='O' && *p!='C' && *p!='r') {
17701770
goto outexcept;
17711771
}
17721772
intern->ar_flags &= ~SPL_ARRAY_CLONE_MASK;

ext/spl/tests/bug62672.phpt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--TEST--
2+
Bug #62672 (Error on serialize of ArrayObject)
3+
--FILE--
4+
<?php
5+
6+
class ObjA
7+
{
8+
private $_varA;
9+
10+
public function __construct(Iterator $source)
11+
{
12+
$this->_varA = $source;
13+
}
14+
}
15+
16+
class ObjB extends ObjA
17+
{
18+
private $_varB;
19+
20+
public function __construct(ArrayObject $keys)
21+
{
22+
$this->_varB = $keys;
23+
parent::__construct($keys->getIterator());
24+
}
25+
}
26+
27+
$obj = new ObjB(new ArrayObject());
28+
29+
var_dump($obj == unserialize(serialize($obj)));
30+
--EXPECTF--
31+
bool(true)

ext/standard/info.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ static void php_info_print_stream_hash(const char *name, HashTable *ht TSRMLS_DC
117117
zend_hash_internal_pointer_reset_ex(ht, &pos);
118118
while (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING)
119119
{
120-
php_info_print(key);
120+
if (!sapi_module.phpinfo_as_text) {
121+
php_info_print_html_esc(key, len-1);
122+
} else {
123+
php_info_print(key);
124+
}
121125
zend_hash_move_forward_ex(ht, &pos);
122126
if (zend_hash_get_current_key_ex(ht, &key, &len, NULL, 0, &pos) == HASH_KEY_IS_STRING) {
123127
php_info_print(", ");

0 commit comments

Comments
 (0)