markup.c: markup_unquote(): Unquote things in the correct order

Because "&" is not the last character to be unescaped, it is possible that
the lines for "<" and ">" expand some things they shouldn't.

For example, "&amp;lt;" should become "&lt;", but instead it becomes ">".
While this is unlikely to appear naturally in a notification, it is wrong.
This commit is contained in:
Luke Shumaker 2017-03-08 14:37:14 -05:00
parent 18c4b4bf7a
commit 1f77b28691

View File

@ -28,9 +28,9 @@ static char *markup_unquote(char *str)
str = string_replace_all("&quot;", "\"", str); str = string_replace_all("&quot;", "\"", str);
str = string_replace_all("&apos;", "'", str); str = string_replace_all("&apos;", "'", str);
str = string_replace_all("&amp;", "&", str);
str = string_replace_all("&lt;", "<", str); str = string_replace_all("&lt;", "<", str);
str = string_replace_all("&gt;", ">", str); str = string_replace_all("&gt;", ">", str);
str = string_replace_all("&amp;", "&", str);
return str; return str;
} }