Skip to content

Commit

Permalink
Encode URL & titles in social bookmarklets
Browse files Browse the repository at this point in the history
  • Loading branch information
ozh committed Jun 10, 2013
1 parent 90169db commit 7853a28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit 7853a28

Please sign in to comment.