summaryrefslogtreecommitdiff
path: root/core/string/ustring.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-11-11 07:58:01 +0100
committerGitHub <noreply@github.com>2021-11-11 07:58:01 +0100
commita5015b639097e3eab14f83de8312415a8ad1956e (patch)
treebd7e672892dbd16fa1df5af98cc59925f1b93750 /core/string/ustring.cpp
parent7211012c4f1a737a78436a55fd1c66d7e323b668 (diff)
parent367d75fab0ba0e8f6bc76da1ef182fc342c4fa0d (diff)
Merge pull request #54861 from timothyqiu/escape
Add missing characters for property name quoting
Diffstat (limited to 'core/string/ustring.cpp')
-rw-r--r--core/string/ustring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 8d6da31cf3..25c21486d6 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -4420,7 +4420,7 @@ String String::property_name_encode() const {
// as well as '"', '=' or ' ' (32)
const char32_t *cstr = get_data();
for (int i = 0; cstr[i]; i++) {
- if (cstr[i] == '=' || cstr[i] == '"' || cstr[i] < 33 || cstr[i] > 126) {
+ if (cstr[i] == '=' || cstr[i] == '"' || cstr[i] == ';' || cstr[i] == '[' || cstr[i] == ']' || cstr[i] < 33 || cstr[i] > 126) {
return "\"" + c_escape_multiline() + "\"";
}
}