Missing proper url encoding
-
Hello, thanks for this plugin.
I have your plugin installed on my Arabic blog. When trying to share via the twitter button added by the plugin it does not properly encode the url, living Arabic characters as they are in the post link. This leads to a truncated link.
For exemple:This is a properly encoded post on my blog :
http :// www .eyil.info/2015/02/%D8%AA%D8%B9%D9%8A%D9%8A%D9%86-%D9%83%D9%84%D9%85%D8%A9-%D8%B3%D8%B1-%D8%B1%D8%A6%D9%8A%D8%B3%D8%A9-%D9%81%D9%8A-%D9%81%D9%8A%D8%B1%D9%81%D9%88%D9%83%D8%B3/
And this is how it appears when sharing via SSBA:
http :// www .eyil.info/2015/02/تعيين-كلمة-سر-رئيسة-في-فيرفوكس/
Just the first part of the link shared via SSBA will appear clickable in the tweet.
I looked at the plugin file and realized these lines of code:
if ($booShortCode == FALSE) { // use wordpress functions for page/post details $urlCurrentPage = get_permalink($post->ID); $strPageTitle = get_the_title($post->ID); }the $urlCurrentPage gets the permalink of the post, I just added urlencode like this:
if ($booShortCode == FALSE) { // use wordpress functions for page/post details // @Zeine77 Begin Edit // replacing get_permalink($post->ID) with urlencode(get_permalink($post->ID)) $urlCurrentPage = urlencode(get_permalink($post->ID)); // @zeine77 End Edit Feb 25, 29 $strPageTitle = get_the_title($post->ID); }And the link shared via the twitter button worked as expected.
What do you think about that ? Is there any other effects of doing so?
I hope I was clear, thanks again for your work.
The topic ‘Missing proper url encoding’ is closed to new replies.