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:
Joe Watkins 2017-07-10 06:53:43 +01:00
commit ccd0ff3ac4
No known key found for this signature in database
GPG key ID: F9BA0ADA31CBD89E
3 changed files with 26 additions and 5 deletions

4
NEWS
View file

@ -10,6 +10,10 @@ PHP NEWS
. Fixed bug #74761 (Unary operator expected error on some systems). (petk) . Fixed bug #74761 (Unary operator expected error on some systems). (petk)
. Fixed bug #73900 (Use After Free in unserialize() SplFixedArray). (nikic) . Fixed bug #73900 (Use After Free in unserialize() SplFixedArray). (nikic)
- Date:
. Fixed bug #74852 (property_exists returns true on unknown DateInterval
property). (jhdxr)
- OCI8: - OCI8:
. Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge) . Fixed bug #74625 (Integer overflow in oci_bind_array_by_name). (Ingmar Runge)

View file

@ -1998,7 +1998,7 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
zval *prop; zval *prop;
int retval = 0; int retval = 0;
if (Z_TYPE_P(member) != IS_STRING) { if (UNEXPECTED(Z_TYPE_P(member) != IS_STRING)) {
ZVAL_COPY(&tmp_member, member); ZVAL_COPY(&tmp_member, member);
convert_to_string(&tmp_member); convert_to_string(&tmp_member);
member = &tmp_member; member = &tmp_member;
@ -2014,10 +2014,10 @@ static int date_interval_has_property(zval *object, zval *member, int type, void
} }
return retval; return retval;
} }
prop = date_interval_read_property(object, member, type, cache_slot, &rv); prop = date_interval_read_property(object, member, BP_VAR_IS, cache_slot, &rv);
if (prop != NULL) { if (prop != &EG(uninitialized_zval)) {
if (type == 2) { if (type == 2) {
retval = 1; retval = 1;
} else if (type == 1) { } else if (type == 1) {

View 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