tony2001                Fri Jul  8 08:30:24 2005 EDT

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/standard       head.c 
  Log:
  fix #33597 (setcookie() "expires" date format doesn't comply with RFC)
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1988&r2=1.1989&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1988 php-src/NEWS:1.1989
--- php-src/NEWS:1.1988 Thu Jul  7 20:40:32 2005
+++ php-src/NEWS        Fri Jul  8 08:30:22 2005
@@ -14,6 +14,8 @@
 - Fixed crash inside stream_get_line() when length parameter equals 0. (Ilia)
 - Fixed bug #33605 (substr_compare() crashes with negative offset and length). 
   (Tony)
+- Fixed bug #33597 (setcookie() "expires" date format doesn't comply with RFC).
+  (Tony)
 - Fixed bug #33578 (strtotime() doesn't understand "11 Oct" format). (Derick)
 - Fixed bug #33562 (date("") crashes). (Derick)
 - Fixed bug #33536 (strtotime() defaults to now even on non time string).
http://cvs.php.net/diff.php/php-src/ext/standard/head.c?r1=1.78&r2=1.79&ty=u
Index: php-src/ext/standard/head.c
diff -u php-src/ext/standard/head.c:1.78 php-src/ext/standard/head.c:1.79
--- php-src/ext/standard/head.c:1.78    Fri Jan  7 15:55:46 2005
+++ php-src/ext/standard/head.c Fri Jul  8 08:30:24 2005
@@ -15,11 +15,12 @@
    | Author: Rasmus Lerdorf <[EMAIL PROTECTED]>                        |
    +----------------------------------------------------------------------+
  */
-/* $Id: head.c,v 1.78 2005/01/07 20:55:46 tony2001 Exp $ */
+/* $Id: head.c,v 1.79 2005/07/08 12:30:24 tony2001 Exp $ */
 
 #include <stdio.h>
 #include "php.h"
 #include "ext/standard/php_standard.h"
+#include "ext/date/php_date.h"
 #include "SAPI.h"
 #include "php_main.h"
 #include "head.h"
@@ -103,15 +104,16 @@
                 * pick an expiry date 1 year and 1 second in the past
                 */
                t = time(NULL) - 31536001;
-               dt = php_std_date(t TSRMLS_CC);
-               sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s", name, dt);
+               dt = php_format_date("D, d-M-Y H:i:s", sizeof("D, d-M-Y 
H:i:s")-1, t, 0);
+               sprintf(cookie, "Set-Cookie: %s=deleted; expires=%s GMT", name, 
dt);
                efree(dt);
        } else {
                sprintf(cookie, "Set-Cookie: %s=%s", name, value ? 
encoded_value : "");
                if (expires > 0) {
                        strcat(cookie, "; expires=");
-                       dt = php_std_date(expires TSRMLS_CC);
+                       dt = php_format_date("D, d-M-Y H:i:s", sizeof("D, d-M-Y 
H:i:s")-1, t, 0);
                        strcat(cookie, dt);
+                       strcat(cookie, " GMT");
                        efree(dt);
                }
        }

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

Reply via email to