Browse Source

Util: Fix parsing solidus '/'

master
Riyyi 3 years ago
parent
commit
8e92317f9e
  1. 5
      src/util/json/parser.cpp

5
src/util/json/parser.cpp

@ -246,7 +246,7 @@ Value Parser::getString()
return "\\\\"; return "\\\\";
break; break;
case '/': case '/':
return "\\/"; return "/";
break; break;
case '\b': case '\b':
return "\\b"; return "\\b";
@ -284,8 +284,7 @@ Value Parser::getString()
continue; continue;
} }
if (character == '"' || character == '\\' || character == '/' if (character == '"' || (character >= 0 && character <= 31)) {
|| (character >= 0 && character <= 31)) {
reportError(token, "invalid string, unescaped character found"); reportError(token, "invalid string, unescaped character found");
return nullptr; return nullptr;
} }

Loading…
Cancel
Save