diff --git a/peach-web/src/routes/scuttlebutt/profile.rs b/peach-web/src/routes/scuttlebutt/profile.rs index feecdb7..43875ac 100644 --- a/peach-web/src/routes/scuttlebutt/profile.rs +++ b/peach-web/src/routes/scuttlebutt/profile.rs @@ -83,13 +83,15 @@ fn social_interaction_buttons_template(profile: &Profile) -> Markup { @match (profile.following, &profile.id) { (Some(false), Some(ssb_id)) => { form id="followForm" class="center" action="/scuttlebutt/follow" method="post" { - input type="hidden" id="publicKey" name="public_key" value=(ssb_id); + // url encode the ssb_id value + input type="hidden" id="publicKey" name="public_key" value=(ssb_id.replace('/', "%2F")); input id="followPeer" class="button button-primary center" type="submit" title="Follow Peer" value="Follow"; } }, (Some(true), Some(ssb_id)) => { form id="unfollowForm" class="center" action="/scuttlebutt/unfollow" method="post" { - input type="hidden" id="publicKey" name="public_key" value=(ssb_id); + // url encode the ssb_id value + input type="hidden" id="publicKey" name="public_key" value=(ssb_id.replace('/', "%2F")); input id="unfollowPeer" class="button button-primary center" type="submit" title="Unfollow Peer" value="Unfollow"; } }, @@ -98,13 +100,15 @@ fn social_interaction_buttons_template(profile: &Profile) -> Markup { @match (profile.blocking, &profile.id) { (Some(false), Some(ssb_id)) => { form id="blockForm" class="center" action="/scuttlebutt/block" method="post" { - input type="hidden" id="publicKey" name="public_key" value=(ssb_id); + // url encode the ssb_id value + input type="hidden" id="publicKey" name="public_key" value=(ssb_id.replace('/', "%2F")); input id="blockPeer" class="button button-primary center" type="submit" title="Block Peer" value="Block"; } }, (Some(true), Some(ssb_id)) => { form id="unblockForm" class="center" action="/scuttlebutt/unblock" method="post" { - input type="hidden" id="publicKey" name="public_key" value=(ssb_id); + // url encode the ssb_id value + input type="hidden" id="publicKey" name="public_key" value=(ssb_id.replace('/', "%2F")); input id="unblockPeer" class="button button-primary center" type="submit" title="Unblock Peer" value="Unblock"; } }, @@ -112,7 +116,8 @@ fn social_interaction_buttons_template(profile: &Profile) -> Markup { } @if let Some(ssb_id) = &profile.id { form class="center" { - a id="privateMessage" class="button button-primary center" href={ "/scuttlebutt/private/" (ssb_id) } title="Private Message" { + // url encode the ssb_id + a id="privateMessage" class="button button-primary center" href={ "/scuttlebutt/private/" (ssb_id.replace('/', "%2F")) } title="Private Message" { "Send Private Message" } }