myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-426


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-426-g3c5d640
Date: Wed, 02 Feb 2011 01:20:13 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  3c5d6408cf9b619c9dfdfb94ff52e141eb8a42f2 (commit)
      from  d2eca5ba371154230cac112f8bb9e502b87facc6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit 3c5d6408cf9b619c9dfdfb94ff52e141eb8a42f2
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Feb 2 02:16:33 2011 +0100

    HttpDir: Replace some characters in the HTML output.

diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index 36fb6ec..62ca29d 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -234,6 +234,7 @@ void HttpDir::generateElement (MemBuf &out,
 
   for (;;)
   {
+    char c;
     while (*cur && ((*cur == '%' ) || (*cur == ' ' )))
       cur++;
 
@@ -246,7 +247,36 @@ void HttpDir::generateElement (MemBuf &out,
       out << "<td><a href=\"";
       out << linkPrefix << name;
       out << "\">" ;
-      out << file.name;
+
+      for (string::iterator i = file.name.begin (); i != file.name.end (); i++)
+        {
+          c = *i;
+          switch (c)
+            {
+            case '<':
+              out << "&lt;";
+              break;
+
+            case '>':
+              out << "&gt;";
+              break;
+
+            case '"':
+              out << "&quot;";
+              break;
+
+            case '\'':
+              out << "&apos;";
+              break;
+
+            case '&':
+              out << "&amp;";
+              break;
+
+            default:
+              out << c;
+            }
+        }
       out << "</a></td>\r\n";
       break;
 

-----------------------------------------------------------------------

Summary of changes:
 myserver/src/http_handler/http_dir/http_dir.cpp |   32 ++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]