]> granicus.if.org Git - apache/commitdiff
weekday and monthnames are locale dependent...
authorAndré Malo <nd@apache.org>
Tue, 13 Jan 2004 02:11:14 +0000 (02:11 +0000)
committerAndré Malo <nd@apache.org>
Tue, 13 Jan 2004 02:11:14 +0000 (02:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102313 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/mappers/mod_rewrite.c

diff --git a/CHANGES b/CHANGES
index 5285a4ad9418b4ab81e9ed1534342c0f40d60627..bf5c2040417df185920a8bd33829d97cb9e9ea34 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) mod_rewrite: Cookie creation now works locale independent.
+     [André Malo]
+
   *) mod_usertrack no longer inspects the Cookie2 header for
      the cookie name. PR 11475.  [Chris Darrochi <chrisd pearsoncmg.com>]
 
index 2823418bceeee77f6930a45b1aa78148b4e797e4..dd95cff9a613f9f5614e6a81b9dce3dd9ad4e29b 100644 (file)
@@ -2265,21 +2265,30 @@ static void add_cookie(request_rec *r, char *s)
         notename = apr_pstrcat(rmain->pool, var, "_rewrite", NULL);
         apr_pool_userdata_get(&data, notename, rmain->pool);
         if (!data) {
+            char *exp_time = NULL;
+
             expires = apr_strtok(NULL, ":", &tok_cntx);
             path = expires ? apr_strtok(NULL, ":", &tok_cntx) : NULL;
 
+            if (expires) {
+                apr_time_exp_t tms;
+                apr_time_exp_gmt(&tms, r->request_time
+                                     + apr_time_from_sec((60 * atol(expires))));
+                exp_time = apr_psprintf(r->pool, "%s, %.2d-%s-%.4d "
+                                                 "%.2d:%.2d:%.2d GMT",
+                                        apr_day_snames[tms.tm_wday],
+                                        tms.tm_mday,
+                                        apr_month_snames[tms.tm_mon],
+                                        tms.tm_year+1900,
+                                        tms.tm_hour, tms.tm_min, tms.tm_sec);
+            }
+
             cookie = apr_pstrcat(rmain->pool,
                                  var, "=", val,
-                                 "; path=", (path)? path : "/",
+                                 "; path=", path ? path : "/",
                                  "; domain=", domain,
-                                 (expires)? "; expires=" : NULL,
-                                 (expires)?
-                                 ap_ht_time(r->pool,
-                                            r->request_time +
-                                            apr_time_from_sec((60 *
-                                                               atol(expires))),
-                                            "%a, %d-%b-%Y %T GMT", 1)
-                                          : NULL,
+                                 expires ? "; expires=" : NULL,
+                                 expires ? exp_time : NULL,
                                  NULL);
 
             apr_table_add(rmain->err_headers_out, "Set-Cookie", cookie);