diff options
author | LimestaX <limecicila@gmail.com> | 2023-12-21 23:35:24 -0500 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-08 11:42:30 +0100 |
commit | 0a32c160ac89edbb7f48c34e21768c5cc85704af (patch) | |
tree | c1b6ffe42b177463d8c2bdfc87f7658c56f09948 | |
parent | c8c483cf57a768110fce57e509f9b855e69d34b7 (diff) | |
download | redot-engine-0a32c160ac89edbb7f48c34e21768c5cc85704af.tar.gz |
Ensure special characters are escaped in tscn connections and editable hint
-rw-r--r-- | scene/resources/resource_format_text.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 29cd9f648d..a97ff5054d 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -2289,10 +2289,10 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso } String connstr = "[connection"; - connstr += " signal=\"" + String(state->get_connection_signal(i)) + "\""; - connstr += " from=\"" + String(state->get_connection_source(i).simplified()) + "\""; - connstr += " to=\"" + String(state->get_connection_target(i).simplified()) + "\""; - connstr += " method=\"" + String(state->get_connection_method(i)) + "\""; + connstr += " signal=\"" + String(state->get_connection_signal(i)).c_escape() + "\""; + connstr += " from=\"" + String(state->get_connection_source(i).simplified()).c_escape() + "\""; + connstr += " to=\"" + String(state->get_connection_target(i).simplified()).c_escape() + "\""; + connstr += " method=\"" + String(state->get_connection_method(i)).c_escape() + "\""; int flags = state->get_connection_flags(i); if (flags != Object::CONNECT_PERSIST) { connstr += " flags=" + itos(flags); @@ -2319,7 +2319,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso if (i == 0) { f->store_line(""); } - f->store_line("[editable path=\"" + editable_instances[i].operator String() + "\"]"); + f->store_line("[editable path=\"" + editable_instances[i].operator String().c_escape() + "\"]"); } } |