From: Thomas Jarosch Date: Mon, 6 Sep 2004 07:52:25 +0000 (+0000) Subject: libi2common, arnied, ui: (tomj) fix mainpage showerr escaping bug X-Git-Tag: v2.6~228 X-Git-Url: http://developer.intra2net.com/git/?a=commitdiff_plain;h=4b6d914535973cf1879a271b5445f2fa159376cf;p=libi2ncommon libi2common, arnied, ui: (tomj) fix mainpage showerr escaping bug --- diff --git a/src/stringfunc.cpp b/src/stringfunc.cpp index 8f6e14a..2caf99e 100644 --- a/src/stringfunc.cpp +++ b/src/stringfunc.cpp @@ -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, "&", "&"); - replace_all (result, "\"", """); replace_all (result, "ä", "ä"); replace_all (result, "ö", "ö"); replace_all (result, "ü", "ü"); @@ -92,8 +90,15 @@ std::string iso_to_html(const std::string& isostring) replace_all (result, "Ö", "Ö"); replace_all (result, "Ü", "Ü"); replace_all (result, "ß", "ß"); - replace_all (result, "<", "<"); - replace_all (result, ">", ">"); + + // TODO: This needs to be removed soon by a proper + // HTML quoted chars engine. Then we can also remove ü from i18n files. + if (!showerr_bug) { + replace_all (result, "\"", """); + replace_all (result, "&", "&"); + replace_all (result, "<", "<"); + replace_all (result, ">", ">"); + } return result; } diff --git a/src/stringfunc.hxx b/src/stringfunc.hxx index 31b6cfb..cfdc482 100644 --- a/src/stringfunc.hxx +++ b/src/stringfunc.hxx @@ -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);