summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authorCHU Zhaowei <jhdxr@php.net>2018-02-11 21:07:52 +0800
committerJoe <krakjoe@php.net>2018-02-12 09:20:14 +0100
commit51f2a5803fa4f09e212fed4b14ab8b4a003d4ef5 (patch)
treed23d8b1149913f40673effd1e15a12c1325e1a69 /ext/date
parent766271a10588a4e58054ae9c17b2d56b68020879 (diff)
downloadphp-git-51f2a5803fa4f09e212fed4b14ab8b4a003d4ef5.tar.gz
Fixed bug #68406 calling var_dump on a DateTimeZone object modifies it
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/php_date.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 9e52c071d6..df65c22b87 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2417,9 +2417,9 @@ static HashTable *date_object_get_debug_info_timezone(zval *object, int *is_temp
zend_string *tmpstr = zend_string_alloc(sizeof("UTC+05:00")-1, 0);
ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
- tzobj->tzi.utc_offset > 0 ? '-' : '+',
- abs(tzobj->tzi.utc_offset / 60),
- abs((tzobj->tzi.utc_offset % 60)));
+ tzobj->tzi.utc_offset < 0 ? '-' : '+',
+ abs((int)(tzobj->tzi.utc_offset / 3600)),
+ abs(((int)(tzobj->tzi.utc_offset % 3600) / 60)));
ZVAL_NEW_STR(&zv, tmpstr);
}