libi2common, arnied, ui: (tomj) fix mainpage showerr escaping bug
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 6 Sep 2004 07:52:25 +0000 (07:52 +0000)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 6 Sep 2004 07:52:25 +0000 (07:52 +0000)
src/stringfunc.cpp
src/stringfunc.hxx

index 8f6e14a..2caf99e 100644 (file)
@@ -79,12 +79,10 @@ std::string utf8_to_iso(const std::string& utf8string)
     return result;
 }
 
-std::string iso_to_html(const std::string& isostring)
+std::string iso_to_html(const std::string& isostring, bool showerr_bug)
 {
     string result = isostring;
     
-    replace_all (result, "&", "&amp;");
-    replace_all (result, "\"", "&quot;");
     replace_all (result, "ä", "&auml;");
     replace_all (result, "ö", "&ouml;");
     replace_all (result, "ü", "&uuml;");
@@ -92,8 +90,15 @@ std::string iso_to_html(const std::string& isostring)
     replace_all (result, "Ö", "&Ouml;");
     replace_all (result, "Ü", "&Uuml;");
     replace_all (result, "ß", "&szlig;");
-    replace_all (result, "<", "&lt;");
-    replace_all (result, ">", "&gt;");
+
+    // TODO: This needs to be removed soon by a proper 
+    // HTML quoted chars engine. Then we can also remove &uuml; from i18n files.
+    if (!showerr_bug) {
+        replace_all (result, "\"", "&quot;");
+        replace_all (result, "&", "&amp;");
+        replace_all (result, "<", "&lt;");
+        replace_all (result, ">", "&gt;");
+    }
     
     return result;
 }
index 31b6cfb..cfdc482 100644 (file)
@@ -22,7 +22,7 @@ bool replace_all(std::string &base, const std::string &ist, const std::string &s
 
 std::string iso_to_utf8(const std::string& isostring);
 std::string utf8_to_iso(const std::string& utf8string);
-std::string iso_to_html(const std::string& isostring);
+std::string iso_to_html(const std::string& isostring, bool showerr_bug=false);
 
 std::string escape(const std::string &s);