Fossil SCM
Adjust the cgi_rfc822_datetime() routine to use the newer rfc2822 date/time format that uses "+0000" for the timezone instead of "GMT".
Commit
d2a94aa96c78ede34ff4f23f8a554bf7db891a355c964ef6e8458c113330d519
Parent
0336ac7715e721c…
1 file changed
+3
-3
+3
-3
| --- src/cgi.c | ||
| +++ src/cgi.c | ||
| @@ -1929,12 +1929,12 @@ | ||
| 1929 | 1929 | |
| 1930 | 1930 | |
| 1931 | 1931 | /* |
| 1932 | 1932 | ** Returns an RFC822-formatted time string suitable for HTTP headers. |
| 1933 | 1933 | ** The timezone is always GMT. The value returned is always a |
| 1934 | -** string obtained from mprintf() and must be freed using free() to | |
| 1935 | -** avoid a memory leak. | |
| 1934 | +** string obtained from mprintf() and must be freed using fossil_free() | |
| 1935 | +** to avoid a memory leak. | |
| 1936 | 1936 | ** |
| 1937 | 1937 | ** See http://www.faqs.org/rfcs/rfc822.html, section 5 |
| 1938 | 1938 | ** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3. |
| 1939 | 1939 | */ |
| 1940 | 1940 | char *cgi_rfc822_datestamp(time_t now){ |
| @@ -1941,11 +1941,11 @@ | ||
| 1941 | 1941 | struct tm *pTm; |
| 1942 | 1942 | pTm = gmtime(&now); |
| 1943 | 1943 | if( pTm==0 ){ |
| 1944 | 1944 | return mprintf(""); |
| 1945 | 1945 | }else{ |
| 1946 | - return mprintf("%s, %d %s %02d %02d:%02d:%02d GMT", | |
| 1946 | + return mprintf("%s, %d %s %02d %02d:%02d:%02d +0000", | |
| 1947 | 1947 | azDays[pTm->tm_wday], pTm->tm_mday, azMonths[pTm->tm_mon], |
| 1948 | 1948 | pTm->tm_year+1900, pTm->tm_hour, pTm->tm_min, pTm->tm_sec); |
| 1949 | 1949 | } |
| 1950 | 1950 | } |
| 1951 | 1951 | |
| 1952 | 1952 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1929,12 +1929,12 @@ | |
| 1929 | |
| 1930 | |
| 1931 | /* |
| 1932 | ** Returns an RFC822-formatted time string suitable for HTTP headers. |
| 1933 | ** The timezone is always GMT. The value returned is always a |
| 1934 | ** string obtained from mprintf() and must be freed using free() to |
| 1935 | ** avoid a memory leak. |
| 1936 | ** |
| 1937 | ** See http://www.faqs.org/rfcs/rfc822.html, section 5 |
| 1938 | ** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3. |
| 1939 | */ |
| 1940 | char *cgi_rfc822_datestamp(time_t now){ |
| @@ -1941,11 +1941,11 @@ | |
| 1941 | struct tm *pTm; |
| 1942 | pTm = gmtime(&now); |
| 1943 | if( pTm==0 ){ |
| 1944 | return mprintf(""); |
| 1945 | }else{ |
| 1946 | return mprintf("%s, %d %s %02d %02d:%02d:%02d GMT", |
| 1947 | azDays[pTm->tm_wday], pTm->tm_mday, azMonths[pTm->tm_mon], |
| 1948 | pTm->tm_year+1900, pTm->tm_hour, pTm->tm_min, pTm->tm_sec); |
| 1949 | } |
| 1950 | } |
| 1951 | |
| 1952 |
| --- src/cgi.c | |
| +++ src/cgi.c | |
| @@ -1929,12 +1929,12 @@ | |
| 1929 | |
| 1930 | |
| 1931 | /* |
| 1932 | ** Returns an RFC822-formatted time string suitable for HTTP headers. |
| 1933 | ** The timezone is always GMT. The value returned is always a |
| 1934 | ** string obtained from mprintf() and must be freed using fossil_free() |
| 1935 | ** to avoid a memory leak. |
| 1936 | ** |
| 1937 | ** See http://www.faqs.org/rfcs/rfc822.html, section 5 |
| 1938 | ** and http://www.faqs.org/rfcs/rfc2616.html, section 3.3. |
| 1939 | */ |
| 1940 | char *cgi_rfc822_datestamp(time_t now){ |
| @@ -1941,11 +1941,11 @@ | |
| 1941 | struct tm *pTm; |
| 1942 | pTm = gmtime(&now); |
| 1943 | if( pTm==0 ){ |
| 1944 | return mprintf(""); |
| 1945 | }else{ |
| 1946 | return mprintf("%s, %d %s %02d %02d:%02d:%02d +0000", |
| 1947 | azDays[pTm->tm_wday], pTm->tm_mday, azMonths[pTm->tm_mon], |
| 1948 | pTm->tm_year+1900, pTm->tm_hour, pTm->tm_min, pTm->tm_sec); |
| 1949 | } |
| 1950 | } |
| 1951 | |
| 1952 |