Project

General

Profile

lighttpd-1.4.43-mod_dirlisting-html.patch

gstrauss, 2016-12-02 05:16

View differences:

src/mod_dirlisting.c
726 726

  
727 727
	if (p->conf.auto_layout) {
728 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"
729
			"<!DOCTYPE html>\n"
730
			"<html>\n"
731 731
			"<head>\n"
732
			"<title>Index of "
733 732
		));
733
		if (!buffer_string_is_empty(p->conf.encoding)) {
734
			buffer_append_string_len(out, CONST_STR_LEN("<meta charset=\""));
735
			buffer_append_string_buffer(out, p->conf.encoding);
736
			buffer_append_string_len(out, CONST_STR_LEN("\">\n"));
737
		}
738
		buffer_append_string_len(out, CONST_STR_LEN("<title>Index of "));
734 739
		buffer_append_string_encoded(out, CONST_BUF_LEN(con->uri.path), ENCODING_MINIMAL_XML);
735 740
		buffer_append_string_len(out, CONST_STR_LEN("</title>\n"));
736 741

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

  
833 839
	if(p->conf.auto_layout) {
834 840

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

  
843 841
		buffer_append_string_len(out, CONST_STR_LEN(
844 842
			"<div class=\"foot\">"
845 843
		));
......
852 850

  
853 851
		buffer_append_string_len(out, CONST_STR_LEN(
854 852
			"</div>\n"
853
		));
854

  
855
		if (!buffer_string_is_empty(p->conf.external_js)) {
856
			buffer_append_string_len(out, CONST_STR_LEN("<script type=\"text/javascript\" src=\""));
857
			buffer_append_string_buffer(out, p->conf.external_js);
858
			buffer_append_string_len(out, CONST_STR_LEN("\"></script>\n"));
859
		} else if (buffer_is_empty(p->conf.external_js)) {
860
			http_dirlist_append_js_table_resort(out, con);
861
		}
862

  
863
		buffer_append_string_len(out, CONST_STR_LEN(
855 864
			"</body>\n"
856 865
			"</html>\n"
857 866
		));
......
1013 1022
	if (files.used) http_dirls_sort(files.ent, files.used);
1014 1023

  
1015 1024
	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 1025
	http_list_directory_header(srv, con, p, out);
1024 1026

  
1025 1027
	/* directories */