nhttpd: fix empty parameter. Inspecting parameters added values.

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1703 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: 6689a74a00
Author: yjogol <yjogol2@online.de>
Date: 2011-09-19 (Mon, 19 Sep 2011)
This commit is contained in:
yjogol
2011-09-19 17:57:02 +00:00
parent 2cc9893717
commit dc45bf40b8

View File

@@ -368,10 +368,14 @@ void CyhookHandler::printf(const char *fmt, ...) {
TOutType CyhookHandler::checkOutput() {
// get outType
outType = plain; // plain
if (ParamList["format"] == "json" || !(ParamList["json"].empty()) )
if(!(ParamList.empty())) {
if ((ParamList.find("format") != ParamList.end() && ParamList["format"] == "json")
|| (ParamList.find("json") != ParamList.end() && !(ParamList["json"].empty())) )
outType = json;
else if (ParamList["format"] == "xml" || !(ParamList["xml"].empty()) )
else if ((ParamList.find("format") != ParamList.end() && ParamList["format"] == "xml")
|| (ParamList.find("xml") != ParamList.end() && !(ParamList["xml"].empty())) )
outType = xml;
}
return outType;
}
//-----------------------------------------------------------------------------