diff --git a/src/nhttpd/yhttpd_core/yhook.cpp b/src/nhttpd/yhttpd_core/yhook.cpp index 56537c057..7838cefa9 100644 --- a/src/nhttpd/yhttpd_core/yhook.cpp +++ b/src/nhttpd/yhttpd_core/yhook.cpp @@ -444,10 +444,11 @@ std::string CyhookHandler::outSingle(std::string _content) { //----------------------------------------------------------------------------- std::string CyhookHandler::outPair(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: - result = outIndent() + "<" + _key + ">" + _content + ""; + result = outIndent() + "<" + _key + ">" + _content + ""; break; case json: result = outIndent() + "\"" + _key + "\": \"" + _content + "\""; @@ -466,11 +467,12 @@ std::string CyhookHandler::outPair(std::string _key, std::string _content, bool //----------------------------------------------------------------------------- std::string CyhookHandler::outArray(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; + result = outIndent() + "<" + _key + ">\n" + _content + ""; result += "\n"; break; case json: @@ -489,11 +491,12 @@ std::string CyhookHandler::outArray(std::string _key, std::string _content, bool //----------------------------------------------------------------------------- std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; + result = outIndent() + "<" + _key + ">\n" + _content + ""; result += "\n"; break; case json: @@ -511,11 +514,12 @@ std::string CyhookHandler::outArrayItem(std::string _key, std::string _content, } //----------------------------------------------------------------------------- std::string CyhookHandler::outObject(std::string _key, std::string _content, bool _next) { - std::string result = ""; + std::string result = "", _key_close = "", tmp; + ySplitString(_key, " ", _key_close, tmp); switch (outType) { case xml: //TODO: xml check and DESC check - result = outIndent() + "<" + _key + ">\n" + _content + ""; + result = outIndent() + "<" + _key + ">\n" + _content + ""; result += "\n"; break; case json: