diff options
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; } |