mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-02 22:50:20 +00:00
Allow \/ in a json string
This commit is contained in:
parent
e7ecc348f9
commit
36794a60cf
@ -1,3 +1,8 @@
|
|||||||
|
2022-02-25 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
|
* Bug fix in JSON parser: accept \/ in a string as valid input per
|
||||||
|
JSON spec even though we don't translate / to \/ on output.
|
||||||
|
|
||||||
2022-02-22 Jay Berkenbilt <ejb@ql.org>
|
2022-02-22 Jay Berkenbilt <ejb@ql.org>
|
||||||
|
|
||||||
* Recognize PDF strings explicitly marked as UTF-8 as allowed by
|
* Recognize PDF strings explicitly marked as UTF-8 as allowed by
|
||||||
|
@ -629,6 +629,9 @@ JSONParser::decode_string(std::string const& str)
|
|||||||
{
|
{
|
||||||
case '\\':
|
case '\\':
|
||||||
case '\"':
|
case '\"':
|
||||||
|
case '/':
|
||||||
|
// \/ is allowed in json input, but so is /, so we
|
||||||
|
// don't map / to \/ in output.
|
||||||
result.append(1, ch);
|
result.append(1, ch);
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
@ -875,7 +878,7 @@ void JSONParser::getToken()
|
|||||||
|
|
||||||
case ls_backslash:
|
case ls_backslash:
|
||||||
/* cSpell: ignore bfnrt */
|
/* cSpell: ignore bfnrt */
|
||||||
if (strchr("\\\"bfnrt", *p))
|
if (strchr("\\\"/bfnrt", *p))
|
||||||
{
|
{
|
||||||
lex_state = ls_string;
|
lex_state = ls_string;
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{"a": "bcd", "e": [1,
|
{"a": "bcd", "e": [1,
|
||||||
2, 3,4,"five", {"six": 7, "8": 9}, null, true,
|
2, 3,4,"five", {"six": 7, "8": 9}, null, true,
|
||||||
false]}
|
false, "a\b\f\n\r\t\\\"\/z"]}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
false
|
false,
|
||||||
|
"a\b\f\n\r\t\\\"/z"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user