diff options
author | Derick Rethans <github@derickrethans.nl> | 2013-11-27 22:00:53 +0000 |
---|---|---|
committer | Derick Rethans <github@derickrethans.nl> | 2013-11-27 22:00:53 +0000 |
commit | fb0c2cf2245838cba1bd9318925d67a127c7b085 (patch) | |
tree | fdbb26f3990a71ee2f8ea8e8103ae3d6aaf785c6 /ext/date/php_date.c | |
parent | 504c60dc4451b8ede8814530dbfec0ef485f0ca6 (diff) | |
parent | 23ab2575e1be062c2d5e3f80d3ff40cabe14fa2c (diff) | |
download | php-git-fb0c2cf2245838cba1bd9318925d67a127c7b085.tar.gz |
Merge branch 'bug53879' into PHP-5.4
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 7e4de09c1e..b7da07c7bd 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -752,6 +752,14 @@ PHP_RSHUTDOWN_FUNCTION(date) #define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO" +/* + * This comes from various sources that like to contradict. I'm going with the + * format here because of: + * http://msdn.microsoft.com/en-us/library/windows/desktop/aa384321%28v=vs.85%29.aspx + * and http://curl.haxx.se/rfc/cookie_spec.html + */ +#define DATE_FORMAT_COOKIE "l, d-M-Y H:i:s T" + #define DATE_TZ_ERRMSG \ "It is not safe to rely on the system's timezone settings. You are " \ "*required* to use the date.timezone setting or the " \ @@ -783,7 +791,7 @@ PHP_MINIT_FUNCTION(date) * with the variations that the only legal time zone is GMT * and the separators between the elements of the date must be dashes." */ - REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT); + REGISTER_STRING_CONSTANT("DATE_COOKIE", DATE_FORMAT_COOKIE, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_ISO8601", DATE_FORMAT_ISO8601, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_RFC822", DATE_FORMAT_RFC822, CONST_CS | CONST_PERSISTENT); REGISTER_STRING_CONSTANT("DATE_RFC850", DATE_FORMAT_RFC850, CONST_CS | CONST_PERSISTENT); @@ -1948,7 +1956,7 @@ static void date_register_classes(TSRMLS_D) zend_declare_class_constant_stringl(date_ce_date, const_name, sizeof(const_name)-1, value, sizeof(value)-1 TSRMLS_CC); REGISTER_DATE_CLASS_CONST_STRING("ATOM", DATE_FORMAT_RFC3339); - REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_RFC850); + REGISTER_DATE_CLASS_CONST_STRING("COOKIE", DATE_FORMAT_COOKIE); REGISTER_DATE_CLASS_CONST_STRING("ISO8601", DATE_FORMAT_ISO8601); REGISTER_DATE_CLASS_CONST_STRING("RFC822", DATE_FORMAT_RFC822); REGISTER_DATE_CLASS_CONST_STRING("RFC850", DATE_FORMAT_RFC850); |