From bca870f1f8d0d23ac5fe16ed63e6f23023facd0a Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 3 Jan 2021 05:49:45 +0900 Subject: [PATCH 1/2] Percent encode URI for remote_interact --- src/routes/posts.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/posts.rs b/src/routes/posts.rs index 399a87f1..8a792df8 100644 --- a/src/routes/posts.rs +++ b/src/routes/posts.rs @@ -1,5 +1,6 @@ use chrono::Utc; use heck::KebabCase; +use rocket::http::uri::Uri; use rocket::request::LenientForm; use rocket::response::{Flash, Redirect}; use rocket_i18n::I18n; @@ -642,7 +643,7 @@ pub fn remote_interact_post( .and_then(|blog| Post::find_by_slug(&rockets.conn, &slug, blog.id))?; if let Some(uri) = User::fetch_remote_interact_uri(&remote.remote) .ok() - .map(|uri| uri.replace("{uri}", &target.ap_url)) + .map(|uri| uri.replace("{uri}", &Uri::percent_encode(&target.ap_url))) { Ok(Redirect::to(uri).into()) } else { From f8774223d464dba652eacedfbf4c72a2855abc1c Mon Sep 17 00:00:00 2001 From: Kitaiti Makoto Date: Sun, 3 Jan 2021 05:51:38 +0900 Subject: [PATCH 2/2] Update pot file --- po/plume/plume.pot | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/po/plume/plume.pot b/po/plume/plume.pot index 7e55c623..7e5f8059 100644 --- a/po/plume/plume.pot +++ b/po/plume/plume.pot @@ -164,55 +164,55 @@ msgstr "" msgid "To see your notifications, you need to be logged in" msgstr "" -# src/routes/posts.rs:54 +# src/routes/posts.rs:55 msgid "This post isn't published yet." msgstr "" -# src/routes/posts.rs:125 +# src/routes/posts.rs:126 msgid "To write a new post, you need to be logged in" msgstr "" -# src/routes/posts.rs:142 +# src/routes/posts.rs:143 msgid "You are not an author of this blog." msgstr "" -# src/routes/posts.rs:149 +# src/routes/posts.rs:150 msgid "New post" msgstr "" -# src/routes/posts.rs:194 +# src/routes/posts.rs:195 msgid "Edit {0}" msgstr "" -# src/routes/posts.rs:263 +# src/routes/posts.rs:264 msgid "You are not allowed to publish on this blog." msgstr "" -# src/routes/posts.rs:355 +# src/routes/posts.rs:356 msgid "Your article has been updated." msgstr "" -# src/routes/posts.rs:542 +# src/routes/posts.rs:543 msgid "Your article has been saved." msgstr "" -# src/routes/posts.rs:549 +# src/routes/posts.rs:550 msgid "New article" msgstr "" -# src/routes/posts.rs:582 +# src/routes/posts.rs:583 msgid "You are not allowed to delete this article." msgstr "" -# src/routes/posts.rs:607 +# src/routes/posts.rs:608 msgid "Your article has been deleted." msgstr "" -# src/routes/posts.rs:612 +# src/routes/posts.rs:613 msgid "It looks like the article you tried to delete doesn't exist. Maybe it is already gone?" msgstr "" -# src/routes/posts.rs:652 +# src/routes/posts.rs:653 msgid "Couldn't obtain enough information about your account. Please make sure your username is correct." msgstr ""