Skip to content

Commit

Permalink
Bug fix: make server interface recognize booleans encoded as proper x…
Browse files Browse the repository at this point in the history
…mlrpc_c::value_boolean when parsing requests.
  • Loading branch information
ugermann committed Apr 15, 2016
1 parent 63eefe0 commit 35c4abd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions moses/server/TranslationRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ check(std::map<std::string, xmlrpc_c::value> const& param,
{
std::map<std::string, xmlrpc_c::value>::const_iterator m = param.find(key);
if(m == param.end()) return false;

if (m->second.type() == xmlrpc_c::value::TYPE_BOOLEAN)
return xmlrpc_c::value_boolean(m->second);

std::string val = string(xmlrpc_c::value_string(m->second));
if(val == "true" || val == "True" || val == "TRUE" || val == "1") return true;
return false;
Expand Down

0 comments on commit 35c4abd

Please sign in to comment.