ASF Bugzilla – Attachment 34827 Details for
Bug 60846
PR34014 / r903052 changed date format for autoindex
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
PR60846.patch (text/plain), 4.48 KB, created by
Hank Ibell
on 2017-03-15 04:54:34 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Hank Ibell
Created:
2017-03-15 04:54:34 UTC
Size:
4.48 KB
patch
obsolete
>Index: docs/manual/mod/mod_autoindex.html.en >=================================================================== >--- docs/manual/mod/mod_autoindex.html.en (revision 1786977) >+++ docs/manual/mod/mod_autoindex.html.en (working copy) >@@ -856,6 +856,13 @@ > > </dd> > >+ <dt><a name="indexoptions.useolddateformat" id="indexoptions.useolddateformat">UseOldDateFormat</a></dt> >+ >+ <dd>The date format used for the <code>Last Modified</code> field was >+ inadvertently changed to <code>"%Y-%m-%d %H:%M"</code> from >+ <code>"%d-%b-%Y %H:%M"</code>. Setting this option will allow users to >+ use the old date format.</dd> >+ > <dt><a name="indexoptions.versionsort" id="indexoptions.versionsort">VersionSort</a> > (<em>Apache HTTP Server 2.0a3 and later</em>)</dt> > >Index: docs/manual/mod/mod_autoindex.xml >=================================================================== >--- docs/manual/mod/mod_autoindex.xml (revision 1786977) >+++ docs/manual/mod/mod_autoindex.xml (working copy) >@@ -898,6 +898,15 @@ > </highlight> > </dd> > >+ <dt><a name="indexoptions.useolddateformat" >+ id="indexoptions.useolddateformat" >+ >UseOldDateFormat</a></dt> >+ >+ <dd>The date format used for the <code>Last Modified</code> field was >+ inadvertently changed to <code>"%Y-%m-%d %H:%M"</code> from >+ <code>"%d-%b-%Y %H:%M"</code>. Setting this option will allow users to >+ use the old date format.</dd> >+ > <dt><a name="indexoptions.versionsort" > id="indexoptions.versionsort">VersionSort</a> > (<em>Apache HTTP Server 2.0a3 and later</em>)</dt> >Index: modules/generators/mod_autoindex.c >=================================================================== >--- modules/generators/mod_autoindex.c (revision 1786977) >+++ modules/generators/mod_autoindex.c (working copy) >@@ -144,6 +144,7 @@ > > char *ctype; > char *charset; >+ char *datetime_format; > } autoindex_config_rec; > > static char c_by_encoding, c_by_type, c_by_path; >@@ -497,6 +498,9 @@ > else if (!strncasecmp(w, "Charset=", 8)) { > d_cfg->charset = apr_pstrdup(cmd->pool, &w[8]); > } >+ else if (!strncasecmp(w, "UseOldDateFormat", 16)) { >+ d_cfg->datetime_format = "%d-%b-%Y %H:%M"; >+ } > else { > return "Invalid directory indexing option"; > } >@@ -656,6 +660,7 @@ > > new->ctype = add->ctype ? add->ctype : base->ctype; > new->charset = add->charset ? add->charset : base->charset; >+ new->datetime_format = add->datetime_format ? add->datetime_format : base->datetime_format; > > new->alt_list = apr_array_append(p, add->alt_list, base->alt_list); > new->desc_list = apr_array_append(p, add->desc_list, base->desc_list); >@@ -1509,6 +1514,7 @@ > apr_pool_t *scratch; > int name_width; > int desc_width; >+ char *datetime_format; > char *name_scratch; > char *pad_scratch; > char *breakrow = ""; >@@ -1517,6 +1523,7 @@ > > name_width = d->name_width; > desc_width = d->desc_width; >+ datetime_format = d->datetime_format ? d->datetime_format : "%Y-%m-%d %H:%M"; > > if ((autoindex_opts & (FANCY_INDEXING | TABLE_INDEXING)) > == FANCY_INDEXING) { >@@ -1756,9 +1763,9 @@ > apr_time_exp_t ts; > apr_time_exp_lt(&ts, ar[x]->lm); > apr_strftime(time_str, &rv, sizeof(time_str), >- "%Y-%m-%d %H:%M ", >+ datetime_format, > &ts); >- ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\">" : " align=\"right\">",time_str, NULL); >+ ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\">" : " align=\"right\">", time_str, " ", NULL); > } > else { > ap_rvputs(r, "</td><td", (d->style_sheet != NULL) ? " class=\"indexcollastmod\"> " : "> ", NULL); >@@ -1844,8 +1851,9 @@ > apr_time_exp_t ts; > apr_time_exp_lt(&ts, ar[x]->lm); > apr_strftime(time_str, &rv, sizeof(time_str), >- "%Y-%m-%d %H:%M ", &ts); >- ap_rputs(time_str, r); >+ datetime_format, >+ &ts); >+ ap_rvputs(r, time_str, " ", NULL); > } > else { > /*Length="1975-04-07 01:23 " (see 4 lines above) */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60846
: 34827