summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Harkness <bearbin@gmail.com>2013-10-19 22:13:47 +0200
committerAlexander Harkness <bearbin@gmail.com>2013-10-19 22:13:47 +0200
commit0677872d880cd2fd9d67933059a9df1fd08aa0d4 (patch)
treede87670eb613510e9f83cea835a5c2399f7220fe
parentFixed general failings with everything. Fixes #211. (diff)
downloadcuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.tar
cuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.tar.gz
cuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.tar.bz2
cuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.tar.lz
cuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.tar.xz
cuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.tar.zst
cuberite-0677872d880cd2fd9d67933059a9df1fd08aa0d4.zip
-rw-r--r--source/WebAdmin.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/source/WebAdmin.cpp b/source/WebAdmin.cpp
index f72f9f63b..7d17ddc03 100644
--- a/source/WebAdmin.cpp
+++ b/source/WebAdmin.cpp
@@ -400,35 +400,35 @@ AString cWebAdmin::GetBaseURL( const AString& a_URL )
AString cWebAdmin::GetHTMLEscapedString( const AString& a_Input )
{
- // Define a stringstream to write the output to.
- std::stringstream dst;
+ // Define a string to write the output to.
+ AString dst = "";
// Loop over input and substitute HTML characters for their alternatives.
- for (int i = 0; i < a_Input.length(); i++) {
+ for (size_t i = 0; i < a_Input.length(); i++) {
switch ( a_Input[i] )
{
case '&':
- dst << "&amp;";
+ dst =+ "&amp;";
break;
case '\'':
- dst << "&apos;";
+ dst =+ "&apos;";
break;
case '"':
- dst << "&quot;";
+ dst =+ "&quot;";
break;
case '<':
- dst << "&lt;";
+ dst =+ "&lt;";
break;
case '>':
- dst << "&gt;";
+ dst =+ "&gt;";
break;
default:
- dst << a_Input[i];
+ dst =+ a_Input[i];
break;
}
}
- return dst.str();
+ return dst();
}