From f1286280d1bb14d09d8f391fd720783626b706f9 Mon Sep 17 00:00:00 2001 From: Derick Rethans Date: Sun, 7 Mar 2010 13:54:46 +0000 Subject: - Fixed bug #50555 (DateTime::sub() allows 'relative' time modifications). --- ext/date/php_date.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/date/php_date.c') 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; } -- cgit v1.2.1