Escape semicolon when sending toots (close #26)

This commit is contained in:
bleakgrey 2018-05-30 19:42:43 +03:00
parent d2297855ef
commit ffa44d699b
2 changed files with 4 additions and 3 deletions

View File

@ -174,14 +174,15 @@ public class Tootle.PostDialog : Gtk.Dialog {
} }
public void publish_post () { public void publish_post () {
var pars = "?status=%s&visibility=%s".printf (Soup.URI.encode (text.buffer.text, null), visibility_opt.to_string ()); var to_escape = ";";
var pars = "?status=%s&visibility=%s".printf (Soup.URI.encode (text.buffer.text, to_escape), visibility_opt.to_string ());
pars += attachments.get_uri_array (); pars += attachments.get_uri_array ();
if (in_reply_to != null) if (in_reply_to != null)
pars += "&in_reply_to_id=%s".printf (in_reply_to.id.to_string ()); pars += "&in_reply_to_id=%s".printf (in_reply_to.id.to_string ());
if (spoiler.active) { if (spoiler.active) {
pars += "&sensitive=true"; pars += "&sensitive=true";
pars += "&spoiler_text=" + Soup.URI.encode (spoiler_text.buffer.text, null); pars += "&spoiler_text=" + Soup.URI.encode (spoiler_text.buffer.text, to_escape);
} }
var url = "%s/api/v1/statuses%s".printf (Tootle.accounts.formal.instance, pars); var url = "%s/api/v1/statuses%s".printf (Tootle.accounts.formal.instance, pars);

View File

@ -69,7 +69,7 @@ public class Tootle.MainWindow: Gtk.Window {
set_titlebar (header); set_titlebar (header);
grid = new Gtk.Grid (); grid = new Gtk.Grid ();
grid.set_size_request (400, 500); grid.set_size_request (450, 600);
grid.attach (primary_stack, 0, 0, 1, 1); grid.attach (primary_stack, 0, 0, 1, 1);
grid.attach (overlay, 0, 0, 1, 1); grid.attach (overlay, 0, 0, 1, 1);