mirror of
https://github.com/php/php-src.git
synced 2025-08-17 22:48:57 +02:00
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #74852 (property_exists returns true on unknown DateInterval property)
This commit is contained in:
commit
ccd0ff3ac4
3 changed files with 26 additions and 5 deletions
4
NEWS
4
NEWS
|
@ -10,6 +10,10 @@ PHP NEWS
|
|||
. Fixed bug #74761 (Unary operator expected error on some systems). (petk)
|
||||
. Fixed bug #73900 (Use After Free in unserialize() SplFixedArray). (nikic)
|
||||
|
||||
- Date:
|
||||
. Fixed bug #74852 (property_exists returns true on unknown DateInterval
|
||||
property). (jhdxr)
|
||||
|
||||
- OCI8:
|
||||
. Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)
|
||||
|
||||
|
|
|
@ -1998,7 +1998,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
|||
zval *prop;
|
||||
int retval = 0;
|
||||
|
||||
if (Z_TYPE_P(member) != IS_STRING) {
|
||||
if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
|
||||
ZVAL_COPY(&tmp_member, member);
|
||||
convert_to_string(&tmp_member);
|
||||
member = &tmp_member;
|
||||
|
@ -2014,10 +2014,10 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
|
|||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
prop = date_interval_read_property(object, member, type, cache_slot, &rv);
|
||||
|
||||
if (prop != NULL) {
|
||||
|
||||
prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
|
||||
|
||||
if (prop != &EG(uninitialized_zval)) {
|
||||
if (type == 2) {
|
||||
retval = 1;
|
||||
} else if (type == 1) {
|
||||
|
|
17
ext/date/tests/bug74852.phpt
Normal file
17
ext/date/tests/bug74852.phpt
Normal file
|
@ -0,0 +1,17 @@
|
|||
--TEST--
|
||||
Bug #74852 property_exists returns true on unknown DateInterval property
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$interval = new DateInterval('P2D');
|
||||
var_dump(property_exists($interval,'abcde'));
|
||||
var_dump(isset($interval->abcde));
|
||||
var_dump($interval->abcde);
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
bool(false)
|
||||
bool(false)
|
||||
|
||||
Notice: Undefined property: DateInterval::$abcde in %s on line %d
|
||||
NULL
|
Loading…
Add table
Add a link
Reference in a new issue