From 7853a285efa28cc98ed88b7fc2020da116ea26fd Mon Sep 17 00:00:00 2001 From: ozh Date: Mon, 10 Jun 2013 23:05:49 +0200 Subject: [PATCH] Encode URL & titles in social bookmarklets --- admin/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/index.php b/admin/index.php index 4b11bd5..4011bec 100644 --- a/admin/index.php +++ b/admin/index.php @@ -172,7 +172,7 @@ switch ( $_GET['share'] ) { case 'twitter': // share with Twitter - $destination = sprintf( "https://twitter.com/intent/tweet?url=%s&text=%s", $return['shorturl'], $_GET['t'] ); + $destination = sprintf( "https://twitter.com/intent/tweet?url=%s&text=%s", urlencode( $return['shorturl'] ), urlencode( $_GET['t'] ) ); yourls_redirect( $destination, 303 ); // Deal with the case when redirection failed: @@ -183,7 +183,7 @@ case 'facebook': // share with Facebook - $destination = sprintf( "https://www.facebook.com/sharer/sharer.php?u=%s&t=%s", $return['shorturl'], $_GET['t'] ); + $destination = sprintf( "https://www.facebook.com/sharer/sharer.php?u=%s&t=%s", urlencode( $return['shorturl'] ), urlencode( $_GET['t'] ) ); yourls_redirect( $destination, 303 ); // Deal with the case when redirection failed: -- 2.45.0