Skip to content

Commit

Permalink
Merge pull request #86417 from LimestaX/tscn-escape-char-fix
Browse files Browse the repository at this point in the history
Ensure special characters are escaped in TSCN connections and editable hint
  • Loading branch information
akien-mga committed Jan 8, 2024
2 parents ff79ec7 + 0a32c16 commit 48b726d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scene/resources/resource_format_text.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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() + "\"]");
}
}

Expand Down

0 comments on commit 48b726d

Please sign in to comment.