summaryrefslogtreecommitdiff
path: root/src/guiFormSpecMenu.h
diff options
context:
space:
mode:
authorEkdohibs <nathanael.courant@laposte.net>2016-05-05 19:08:45 +0200
committerEkdohibs <nathanael.courant@laposte.net>2016-05-07 08:33:21 +0200
commit4d9dbceb39324ee0aef6520b8193fa093470cc01 (patch)
tree38acd0de36c94b01775d418c560da013833565df /src/guiFormSpecMenu.h
parentd5c3db9c4179e27a80c32ee95d6573ad0ec7137e (diff)
downloadminetest-4d9dbceb39324ee0aef6520b8193fa093470cc01.tar.gz
minetest-4d9dbceb39324ee0aef6520b8193fa093470cc01.tar.bz2
minetest-4d9dbceb39324ee0aef6520b8193fa093470cc01.zip
Run unescape_enriched *after* unescape_string.
Doing it the other way round was a mistake, since it breaks minetest.formspec_escape with escape sequences that contain special characters.
Diffstat (limited to 'src/guiFormSpecMenu.h')
-rw-r--r--src/guiFormSpecMenu.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/guiFormSpecMenu.h b/src/guiFormSpecMenu.h
index 276807438..ef230c81c 100644
--- a/src/guiFormSpecMenu.h
+++ b/src/guiFormSpecMenu.h
@@ -192,14 +192,6 @@ class GUIFormSpecMenu : public GUIModalMenu
bool scale;
};
- /* The responsibility of unescaping the strings has been shifted
- * from the formspec parsing methods to the draw methods.
- * There still are a few exceptions:
- * - Vertical label, because it modifies the string by inserting
- * '\n' between each character,
- * - Tab header, because it gives the string immediately to
- * Irrlicht and we can't unescape it later.
- */
struct FieldSpec
{
FieldSpec()
@@ -210,8 +202,8 @@ class GUIFormSpecMenu : public GUIModalMenu
fname(name),
fid(id)
{
- flabel = unescape_string(unescape_enriched(label));
- fdefault = unescape_string(unescape_enriched(default_text));
+ flabel = unescape_enriched(label);
+ fdefault = unescape_enriched(default_text);
send = false;
ftype = f_Unknown;
is_exit = false;
@@ -247,7 +239,7 @@ class GUIFormSpecMenu : public GUIModalMenu
bgcolor(a_bgcolor),
color(a_color)
{
- tooltip = unescape_string(unescape_enriched(utf8_to_wide(a_tooltip)));
+ tooltip = unescape_enriched(utf8_to_wide(a_tooltip));
}
std::wstring tooltip;
irr::video::SColor bgcolor;
@@ -264,7 +256,7 @@ class GUIFormSpecMenu : public GUIModalMenu
rect(a_rect),
parent_button(NULL)
{
- text = unescape_string(unescape_enriched(a_text));
+ text = unescape_enriched(a_text);
}
StaticTextSpec(const std::wstring &a_text,
const core::rect<s32> &a_rect,
@@ -272,7 +264,7 @@ class GUIFormSpecMenu : public GUIModalMenu
rect(a_rect),
parent_button(a_parent_button)
{
- text = unescape_string(unescape_enriched(a_text));
+ text = unescape_enriched(a_text);
}
std::wstring text;
core::rect<s32> rect;