From a89437b3c168e6d5f38b8e577f31ea89f5c9c8d0 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 15 Jan 2009 21:44:39 +0000 Subject: Modified html.lua and viewlibrary.lua and all html files to html_escape variables before displaying them. git-svn-id: svn://svn.alpinelinux.org/acf/tinydns/trunk@1678 ab2d0c66-481e-0410-8bed-d214d4d58bed --- tinydns-edit-html.lsp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tinydns-edit-html.lsp') diff --git a/tinydns-edit-html.lsp b/tinydns-edit-html.lsp index f8d8dbb..785589a 100644 --- a/tinydns-edit-html.lsp +++ b/tinydns-edit-html.lsp @@ -35,9 +35,9 @@ var entrytext = entry.find("select").val() + entry.find("input:not(.submit)").map(function(){ if (this.name == "fixme") { if ($(this).val() != "") - return $(this).val() + ".<%= domain %>"; + return $(this).val() + ".<%= html.html_escape(domain) %>"; else - return "<%= domain %>"; + return "<%= html.html_escape(domain) %>"; } else { return $(this).val(); } @@ -70,11 +70,11 @@ for (i=0; i' + entryType.descriptions[i] + '
$/i, "") + '" name="fixme"> . <%= domain %>
'; + form = form + '
' + entryType.descriptions[i] + '
$/i, "") + '" name="fixme"> . <%= html.html_escape(domain) %>
'; else form = form + '
' + entryType.descriptions[i] + '
'; } - form = form + '\n
'; + form = form + '\n
'; form = form + "\n"; entry.empty().append(form); entry.find("select").change(function(){ @@ -83,7 +83,7 @@ createForm(entry); }); entry.find("input.submit").click(function() { - $("input[name='<%= form.option %>']").click(); + $("input[name='<%= html.html_escape(form.option) %>']").click(); }); } function editLine(){ @@ -157,8 +157,8 @@ displayitem(form.value.mtime)

File Entries

-<% if form.descr then %>

<%= string.gsub(form.descr, "\n", "
") %>

<% end %> -<% if form.errtxt then %>

<%= string.gsub(form.errtxt, "\n", "
") %>

<% end %> +<% if form.descr then %>

<%= string.gsub(html.html_escape(form.descr), "\n", "
") %>

<% end %> +<% if form.errtxt then %>

<%= string.gsub(html.html_escape(form.errtxt), "\n", "
") %>

<% end %> <% for line in string.gmatch(html.html_escape(form.value.filecontent.value).."\n", "([^\n]*)\n") do %> @@ -166,11 +166,11 @@ displayitem(form.value.mtime) <% end %>
-<% if form.value.filecontent.errtxt then %>

<%= string.gsub(form.value.filecontent.errtxt, "\n", "
") %>

<% end %> +<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> <% displayformstart(form) %> - +

Save and Apply Above Settings

<% displayformend(form) %> -- cgit v1.2.3