diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-13 09:33:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 09:33:46 +0200 |
commit | e2b79e9591436df76efbeda8abf93a562f66a02f (patch) | |
tree | bbb50fd4f36e5314d70c1c95c86da454bee60f0f /core/string | |
parent | 3adb129a548718a03f1e3159202fb470ca17a8cd (diff) | |
parent | a403efb67c5a0e39911b9bdb3669d5d45b049c7e (diff) |
Merge pull request #49291 from NoFr1ends/fix-49262
String::format leave passed values untouched
Diffstat (limited to 'core/string')
-rw-r--r-- | core/string/ustring.cpp | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 16ecd2b985..4cd2915ffa 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3397,17 +3397,10 @@ String String::format(const Variant &values, String placeholder) const { if (value_arr.size() == 2) { Variant v_key = value_arr[0]; String key = v_key; - if (key.left(1) == "\"" && key.right(1) == "\"") { - key = key.substr(1, key.length() - 2); - } Variant v_val = value_arr[1]; String val = v_val; - if (val.left(1) == "\"" && val.right(1) == "\"") { - val = val.substr(1, val.length() - 2); - } - new_string = new_string.replace(placeholder.replace("_", key), val); } else { ERR_PRINT(String("STRING.format Inner Array size != 2 ").ascii().get_data()); @@ -3416,10 +3409,6 @@ String String::format(const Variant &values, String placeholder) const { Variant v_val = values_arr[i]; String val = v_val; - if (val.left(1) == "\"" && val.right(1) == "\"") { - val = val.substr(1, val.length() - 2); - } - if (placeholder.find("_") > -1) { new_string = new_string.replace(placeholder.replace("_", i_as_str), val); } else { @@ -3436,14 +3425,6 @@ String String::format(const Variant &values, String placeholder) const { String key = E->get(); String val = d[E->get()]; - if (key.left(1) == "\"" && key.right(1) == "\"") { - key = key.substr(1, key.length() - 2); - } - - if (val.left(1) == "\"" && val.right(1) == "\"") { - val = val.substr(1, val.length() - 2); - } - new_string = new_string.replace(placeholder.replace("_", key), val); } } else { |