Skip to content
Merged
25 changes: 25 additions & 0 deletions Zend/tests/gh20177.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--TEST--
GH-20177: Access overridden private property in get_object_vars()
--FILE--
<?php

class A {
private $prop = 'A::$prop';

public function __construct() {
var_dump(get_object_vars($this));
}
}

class B extends A {
protected $prop = 'B::$prop';
}

new B;

?>
--EXPECT--
array(1) {
["prop"]=>
string(8) "A::$prop"
}
5 changes: 5 additions & 0 deletions Zend/zend_object_handlers.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_st
return FAILURE;
}
} else {
/* We were looking for a protected property but found a private one
* belonging to the parent class. */
if (property_info->flags & ZEND_ACC_PRIVATE) {
return FAILURE;
}
ZEND_ASSERT(property_info->flags & ZEND_ACC_PROTECTED);
}
return SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/tests/streams/bug60602.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $descs = array(
2 => array('pipe', 'w'), // strerr
);

$environment = array('test' => array(1, 2, 3));
$environment = array('test' => array(1, 2, 3), 'PATH' => getenv('PATH'));

$cmd = (substr(PHP_OS, 0, 3) == 'WIN') ? 'dir' : 'ls';
$p = proc_open($cmd, $descs, $pipes, '.', $environment);
Expand Down
3 changes: 2 additions & 1 deletion ext/tidy/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ if test "$PHP_TIDY" != "no"; then
])
AS_VAR_IF([php_ac_cv_have_tidyoptgetcategory], [yes],
[AC_DEFINE([HAVE_TIDYOPTGETCATEGORY], [1],
[Define to 1 if tidyOptGetCategory is available.])])
[Define to 1 if Tidy library has the 'tidyOptGetCategory' function and
supports the 'TidyInternalCategory' enumeration.])])

CPPFLAGS=$old_CPPFLAGS

Expand Down
1 change: 1 addition & 0 deletions ext/tidy/config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ if (PHP_TIDY != "no") {
AC_DEFINE('HAVE_TIDY_H', 1, "Define to 1 if you have the <tidy.h> header file.")
AC_DEFINE('HAVE_TIDYOPTGETDOC', 1, "Define to 1 if Tidy library has the 'tidyOptGetDoc' function.")
AC_DEFINE('HAVE_TIDYRELEASEDATE', 1, "Define to 1 if Tidy library has the 'tidyReleaseDate' function.")
AC_DEFINE('HAVE_TIDYOPTGETCATEGORY', 1, "Define to 1 if Tidy library has the 'tidyOptGetCategory' function and supports the 'TidyInternalCategory' enumeration.")
ADD_FLAG('CFLAGS_TIDY', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
if (!PHP_TIDY_SHARED) {
ADD_DEF_FILE("ext\\tidy\\php_tidy.def");
Expand Down