diff options
| author | Derick Rethans <derick@php.net> | 2010-03-07 13:54:46 +0000 |
|---|---|---|
| committer | Derick Rethans <derick@php.net> | 2010-03-07 13:54:46 +0000 |
| commit | f1286280d1bb14d09d8f391fd720783626b706f9 (patch) | |
| tree | 126f5e645591ce226cf85a13ee96d82efe0585dd /ext/date/php_date.c | |
| parent | a2ad4ea8b5be87c81a483c2064b82878d39a4017 (diff) | |
| download | php-git-f1286280d1bb14d09d8f391fd720783626b706f9.tar.gz | |
- Fixed bug #50555 (DateTime::sub() allows 'relative' time modifications).
Diffstat (limited to 'ext/date/php_date.c')
| -rw-r--r-- | ext/date/php_date.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 1530365348..519b796c87 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2851,6 +2851,11 @@ PHP_FUNCTION(date_sub) intobj = (php_interval_obj *) zend_object_store_get_object(interval TSRMLS_CC); DATE_CHECK_INITIALIZED(intobj->initialized, DateInterval); + if (intobj->diff->have_special_relative) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only non-special relative time specifications are supported for subtraction"); + return; + } + if (intobj->diff->invert) { bias = -1; } |
