php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #55397
Patch bug55397.phpt revision 2011-08-14 16:37 UTC by laruence@php.net
revision 2011-08-14 16:09 UTC by laruence@php.net
Patch bug55397.diff revision 2011-08-14 16:37 UTC by laruence@php.net
revision 2011-08-14 16:37 UTC by laruence@php.net
revision 2011-08-14 16:36 UTC by laruence@php.net
revision 2011-08-14 16:09 UTC by laruence@php.net

Patch bug55397.diff for Date/time related Bug #55397

Patch version 2011-08-14 16:37 UTC

Return to Bug #55397 | Download this patch
This patch renders other patches obsolete

Obsolete patches:

Patch Revisions: 2011-08-14 16:37 UTC | 2011-08-14 16:37 UTC | 2011-08-14 16:36 UTC | 2011-08-14 16:09 UTC

Developer: laruence@php.net



  Index: 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,10 @@
 @@ -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) {


  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,11 @@
 @@ -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) {
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 17 21:01:56 2014 UTC