Project

General

Profile

lighttpd-1.4.43-mod_dirlisting-html.patch

altblue, 2016-11-09 03:17

View differences:

src/mod_dirlisting.c
725 725
	UNUSED(srv);
726 726

  
727 727
	if (p->conf.auto_layout) {
728
		buffer_append_string_len(out, CONST_STR_LEN(
729
			"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n"
730
			"<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n"
731
			"<head>\n"
732
			"<title>Index of "
733
		));
728
		buffer_append_string_len(out, CONST_STR_LEN("<!doctype html><html><head>"));
729
		if (!buffer_string_is_empty(p->conf.encoding)) {
730
			buffer_append_string_len(out, CONST_STR_LEN("<meta charset=\""));
731
			buffer_append_string_buffer(out, p->conf.encoding);
732
			buffer_append_string_len(out, CONST_STR_LEN("\">"));
733
		}
734
		buffer_append_string_len(out, CONST_STR_LEN("<title>Index of "));
734 735
		buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML);
735
		buffer_append_string_len(out, CONST_STR_LEN("</title>\n"));
736
		buffer_append_string_len(out, CONST_STR_LEN("</title>"));
736 737

  
737 738
		if (!buffer_string_is_empty(p->conf.external_css)) {
739
			buffer_append_string_len(out, CONST_STR_LEN("<meta name=\"viewport\" content=\"initial-scale=1\">"));
738 740
			buffer_append_string_len(out, CONST_STR_LEN("<link rel=\"stylesheet\" type=\"text/css\" href=\""));
739 741
			buffer_append_string_buffer(out, p->conf.external_css);
740
			buffer_append_string_len(out, CONST_STR_LEN("\" />\n"));
742
			buffer_append_string_len(out, CONST_STR_LEN("\">\n"));
741 743
		} else {
742 744
			buffer_append_string_len(out, CONST_STR_LEN(
743 745
				"<style type=\"text/css\">\n"
......
832 834

  
833 835
	if(p->conf.auto_layout) {
834 836

  
837
		buffer_append_string_len(out, CONST_STR_LEN("<div class=\"foot\">"));
838
		if (!buffer_string_is_empty(p->conf.set_footer)) {
839
			buffer_append_string_buffer(out, p->conf.set_footer);
840
		} else {
841
			buffer_append_string_buffer(out, con->conf.server_tag);
842
		}
843
		buffer_append_string_len(out, CONST_STR_LEN("</div>"));
844

  
835 845
		if (!buffer_string_is_empty(p->conf.external_js)) {
836 846
			buffer_append_string_len(out, CONST_STR_LEN("<script type=\"text/javascript\" src=\""));
837 847
			buffer_append_string_buffer(out, p->conf.external_js);
838
			buffer_append_string_len(out, CONST_STR_LEN("\" />\n"));
848
			buffer_append_string_len(out, CONST_STR_LEN("\"></script>\n"));
839 849
		} else if (buffer_is_empty(p->conf.external_js)) {
840 850
			http_dirlist_append_js_table_resort(out, con);
841 851
		}
842 852

  
843
		buffer_append_string_len(out, CONST_STR_LEN(
844
			"<div class=\"foot\">"
845
		));
846

  
847
		if (!buffer_string_is_empty(p->conf.set_footer)) {
848
			buffer_append_string_buffer(out, p->conf.set_footer);
849
		} else {
850
			buffer_append_string_buffer(out, con->conf.server_tag);
851
		}
852

  
853
		buffer_append_string_len(out, CONST_STR_LEN(
854
			"</div>\n"
855
			"</body>\n"
856
			"</html>\n"
857
		));
853
		buffer_append_string_len(out, CONST_STR_LEN("</body></html>"));
858 854
	}
859 855
}
860 856

  
......
1013 1009
	if (files.used) http_dirls_sort(files.ent, files.used);
1014 1010

  
1015 1011
	out = buffer_init();
1016
	buffer_copy_string_len(out, CONST_STR_LEN("<?xml version=\"1.0\" encoding=\""));
1017
	if (buffer_string_is_empty(p->conf.encoding)) {
1018
		buffer_append_string_len(out, CONST_STR_LEN("iso-8859-1"));
1019
	} else {
1020
		buffer_append_string_buffer(out, p->conf.encoding);
1021
	}
1022
	buffer_append_string_len(out, CONST_STR_LEN("\"?>\n"));
1023 1012
	http_list_directory_header(srv, con, p, out);
1024 1013

  
1025 1014
	/* directories */