Title: Missing proper url encoding
Last modified: August 22, 2016

---

# Missing proper url encoding

 *  Resolved [zeine77](https://wordpress.org/support/users/zeine77/)
 * (@zeine77)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/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.
 * [https://wordpress.org/plugins/simple-share-buttons-adder/](https://wordpress.org/plugins/simple-share-buttons-adder/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Simple Share](https://wordpress.org/support/users/davidoffneal/)
 * (@davidoffneal)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/missing-proper-url-encoding/#post-5836330)
 * Thanks for taking the time to report this and provide a solution.
 * It doesn’t appear to have any issues elsewhere with this applied, so it shall
   be applied to the next version – [http://ge.tt/3Cdof3C2/v/0](http://ge.tt/3Cdof3C2/v/0)
 * Thanks,
 * David

Viewing 1 replies (of 1 total)

The topic ‘Missing proper url encoding’ is closed to new replies.

 * ![](https://ps.w.org/simple-share-buttons-adder/assets/icon-256x256.png?rev=2661516)
 * [Simple Share Buttons Adder](https://wordpress.org/plugins/simple-share-buttons-adder/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-share-buttons-adder/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-share-buttons-adder/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-share-buttons-adder/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-share-buttons-adder/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-share-buttons-adder/reviews/)

## Tags

 * [Arabic](https://wordpress.org/support/topic-tag/arabic/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * 1 reply
 * 2 participants
 * Last reply from: [Simple Share](https://wordpress.org/support/users/davidoffneal/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/missing-proper-url-encoding/#post-5836330)
 * Status: resolved