Browse Source

share_post: prevent double-quoting in Twitter URL

Both parameters being concatenated have already been quoted: don't do
that twice. Do make sure to quote the separating space though.
Giel van Schijndel 10 years ago
parent
commit
1d53067057
1 changed files with 1 additions and 1 deletions
  1. 1 1
      share_post/share_post.py

+ 1 - 1
share_post/share_post.py

@@ -38,7 +38,7 @@ def share_post(content):
     url = article_url(content)
     summary = article_summary(content)
 
-    tweet = quote(('%s %s' % (title, url)).encode('utf-8'))
+    tweet = ('%s%s%s' % (title, quote(' '), url)).encode('utf-8')
     facebook_link = 'http://www.facebook.com/sharer/sharer.php?s=100&p%%5Burl%%5D=%s' % url
     gplus_link = 'https://plus.google.com/share?url=%s' % url
     twitter_link = 'http://twitter.com/home?status=%s' % tweet