php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | |
Patch bug55397.diff for Date/time related Bug #55397Patch version 2011-08-14 16:37 UTC Return to Bug #55397 | Download this patchThis patch renders other patches obsolete Obsolete patches: Patch Revisions:
Developer: laruence@php.netIndex: trunk/ext/date/php_date.c =================================================================== --- trunk/ext/date/php_date.c (revision 314900) +++ trunk/ext/date/php_date.c (working copy) @@ -2066,6 +2066,11 @@ instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); + + if (!o1->time || !o2->time) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Detected an incomplete DataTime object"); + return 1; + } if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); Index: branches/PHP_5_4/ext/date/php_date.c =================================================================== --- branches/PHP_5_4/ext/date/php_date.c (revision 314806) +++ branches/PHP_5_4/ext/date/php_date.c (working copy) @@ -2066,7 +2066,12 @@ instanceof_function(Z_OBJCE_P(d2), date_ce_date TSRMLS_CC)) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); - + + if (!o1->time || !o2->time) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Detected an incomplete DataTime Object"); + return 1; + } + if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); } |
Copyright © 2001-2024 The PHP Group All rights reserved. |
Last updated: Tue Dec 03 17:01:29 2024 UTC |