static void emit_preamble(request_rec *r, char *title)
{
ap_rvputs(r, DOCTYPE_HTML_3_2,
- "<HTML>\n <HEAD>\n <TITLE>Index of ", title,
- "</TITLE>\n </HEAD>\n <BODY>\n", NULL);
+ "<html>\n <head>\n <title>Index of ", title,
+ "</title>\n </head>\n <body>\n", NULL);
}
static void push_item(apr_array_header_t *arr, char *type, const char *to,
apr_size_t i, c, n;
apr_status_t stat;
- ap_rputs("<PRE>\n", r);
+ ap_rputs("<pre>\n", r);
while (!apr_file_eof(f)) {
do {
n = sizeof(char) * AP_IOBUFSIZE;
c = i + 1;
}
}
- ap_rputs("</PRE>\n", r);
+ ap_rputs("</pre>\n", r);
}
/*
else if (!strncasecmp("text/", rr->content_type, 5)) {
/*
* If we can open the file, prefix it with the preamble
- * regardless; since we'll be sending a <PRE> block around
+ * regardless; since we'll be sending a <pre> block around
* the file's contents, any HTML header it had won't end up
* where it belongs.
*/
emit_preamble(r, title);
}
if (emit_H1) {
- ap_rvputs(r, "<H1>Index of ", title, "</H1>\n", NULL);
+ ap_rvputs(r, "<h1>Index of ", title, "</h1>\n", NULL);
}
if (rr != NULL) {
ap_destroy_sub_req(rr);
ap_rputs(ap_psignature("", r), r);
}
if (!suppress_post) {
- ap_rputs("</BODY></HTML>\n", r);
+ ap_rputs("</body></html>\n", r);
}
if (rr != NULL) {
ap_destroy_sub_req(rr);
static char *find_title(request_rec *r)
{
- char titlebuf[MAX_STRING_LEN], *find = "<TITLE>";
+ char titlebuf[MAX_STRING_LEN], *find = "<title>";
apr_file_t *thefile = NULL;
int x, y, p;
apr_size_t n;
}
titlebuf[n] = '\0';
for (x = 0, p = 0; titlebuf[x]; x++) {
- if (apr_toupper(titlebuf[x]) == find[p]) {
+ if (apr_tolower(titlebuf[x]) == find[p]) {
if (!find[++p]) {
if ((p = ap_ind(&titlebuf[++x], '<')) != -1) {
titlebuf[x + p] = '\0';
qvalue[4] = '\0';
reverse = ((curkey == fname) && (curdirection == D_ASCENDING));
qvalue[3] = reverse ? D_DESCENDING : D_ASCENDING;
- ap_rvputs(r, "<A HREF=\"", qvalue, "\">", anchor, "</A>", NULL);
+ ap_rvputs(r, "<a href=\"", qvalue, "\">", anchor, "</a>", NULL);
}
else {
ap_rputs(anchor, r);
pad_scratch[name_width] = '\0';
if (autoindex_opts & FANCY_INDEXING) {
- ap_rputs("<PRE>", r);
+ ap_rputs("<pre>", r);
if ((tp = find_default_icon(d, "^^BLANKICON^^"))) {
- ap_rvputs(r, "<IMG SRC=\"", ap_escape_html(scratch, tp),
- "\" ALT=\" \"", NULL);
- if (d->icon_width && d->icon_height) {
- ap_rprintf
- (
- r,
- " HEIGHT=\"%d\" WIDTH=\"%d\"",
- d->icon_height,
- d->icon_width
- );
- }
- ap_rputs("> ", r);
+ ap_rvputs(r, "<img src=\"", ap_escape_html(scratch, tp),
+ "\" alt=\" \"", NULL);
+ if (d->icon_width)
+ ap_rprintf(r, " width=\"%d\"", d->icon_width);
+ if (d->icon_height)
+ ap_rprintf(r, " height=\"%d\"", d->icon_height);
+ ap_rputs(" /> ", r);
}
emit_link(r, "Name", K_NAME, keyid, direction, static_columns);
ap_rputs(pad_scratch + 4, r);
emit_link(r, "Description", K_DESC, keyid, direction,
static_columns);
}
- ap_rputs("\n<HR>\n", r);
+ ap_rputs("\n<hr />\n", r);
}
else {
- ap_rputs("<UL>", r);
+ ap_rputs("<ul>", r);
}
for (x = 0; x < n; x++) {
if (autoindex_opts & FANCY_INDEXING) {
if (autoindex_opts & ICONS_ARE_LINKS) {
- ap_rvputs(r, "<A HREF=\"", anchor, "\">", NULL);
+ ap_rvputs(r, "<a href=\"", anchor, "\">", NULL);
}
if ((ar[x]->icon) || d->default_icon) {
- ap_rvputs(r, "<IMG SRC=\"",
+ ap_rvputs(r, "<img src=\"",
ap_escape_html(scratch,
ar[x]->icon ? ar[x]->icon
: d->default_icon),
- "\" ALT=\"[", (ar[x]->alt ? ar[x]->alt : " "),
+ "\" alt=\"[", (ar[x]->alt ? ar[x]->alt : " "),
"]\"", NULL);
- if (d->icon_width && d->icon_height) {
- ap_rprintf(r, " HEIGHT=\"%d\" WIDTH=\"%d\"",
- d->icon_height, d->icon_width);
- }
- ap_rputs(">", r);
+ if (d->icon_width)
+ ap_rprintf(r, " width=\"%d\"", d->icon_width);
+ if (d->icon_height)
+ ap_rprintf(r, " height=\"%d\"", d->icon_height);
+ ap_rputs(" />", r);
}
if (autoindex_opts & ICONS_ARE_LINKS) {
- ap_rputs("</A>", r);
+ ap_rputs("</a>", r);
}
nwidth = strlen(t2);
t2 = name_scratch;
nwidth = name_width;
}
- ap_rvputs(r, " <A HREF=\"", anchor, "\">",
- ap_escape_html(scratch, t2), "</A>", pad_scratch + nwidth,
+ ap_rvputs(r, " <a href=\"", anchor, "\">",
+ ap_escape_html(scratch, t2), "</a>", pad_scratch + nwidth,
NULL);
/*
* The blank before the storm.. er, before the next field.
}
}
else {
- ap_rvputs(r, "<LI><A HREF=\"", anchor, "\"> ", t2,
- "</A>", NULL);
+ ap_rvputs(r, "<li /><a href=\"", anchor, "\"> ", t2,
+ "</a>", NULL);
}
ap_rputc('\n', r);
}
if (autoindex_opts & FANCY_INDEXING) {
- ap_rputs("</PRE>", r);
+ ap_rputs("</pre>", r);
}
else {
- ap_rputs("</UL>", r);
+ ap_rputs("</ul>", r);
}
}
apr_dir_close(thedir);
if (autoindex_opts & FANCY_INDEXING) {
- ap_rputs("<HR>\n", r);
+ ap_rputs("<hr />\n", r);
}
emit_tail(r, find_readme(autoindex_conf, r),
autoindex_opts & SUPPRESS_PREAMBLE);