iliaa           Tue Jul 27 21:44:41 2004 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src    NEWS 
    /php-src/ext/standard       datetime.c 
  Log:
  MFH: Fixed bug #29342 (strtotime() does not handle empty date string 
  properly).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.11&r2=1.1760.2.12&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.11 php-src/NEWS:1.1760.2.12
--- php-src/NEWS:1.1760.2.11    Tue Jul 27 12:40:46 2004
+++ php-src/NEWS        Tue Jul 27 21:44:41 2004
@@ -7,6 +7,8 @@
   strings). (Ilia, Tony)
 - Fixed bug #29368 (The destructor is called when an exception is thrown from 
   the constructor). (Marcus)
+- Fixed bug #29342 (strtotime() does not handle empty date string properly).
+  (Ilia)
 - Fixed bug #29335 (fetch functions now use MYSQLI_BOTH as default) (Georg)
 - Fixed bug #29291 (get_class_vars() return names with NULLs). (Marcus)
 - Fixed bug #29119 (html_entity_decode() misbehaves with UTF-8). (Moriyoshi)
http://cvs.php.net/diff.php/php-src/ext/standard/datetime.c?r1=1.121&r2=1.121.2.1&ty=u
Index: php-src/ext/standard/datetime.c
diff -u php-src/ext/standard/datetime.c:1.121 php-src/ext/standard/datetime.c:1.121.2.1
--- php-src/ext/standard/datetime.c:1.121       Mon Jun 28 10:33:57 2004
+++ php-src/ext/standard/datetime.c     Tue Jul 27 21:44:41 2004
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: datetime.c,v 1.121 2004/06/28 14:33:57 derick Exp $ */
+/* $Id: datetime.c,v 1.121.2.1 2004/07/28 01:44:41 iliaa Exp $ */
 
 #include "php.h"
 #include "zend_operators.h"
@@ -1080,8 +1080,10 @@
        }
 
        convert_to_string_ex(z_time);
-       if (Z_STRLEN_PP(z_time) == 0)
-               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Called with empty time 
parameter");
+       if (!Z_STRLEN_PP(z_time)) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "Called with an empty time 
parameter.");
+               RETURN_LONG(-1);
+       }
        if (argc == 2) {
                convert_to_long_ex(z_now);
                now = Z_LVAL_PP(z_now);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to