WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Links
[resolved] Special characters in the url (10 posts)

  1. notsebastien
    Member
    Posted 1 year ago #

    Hi MrMaz,

    First of all, I really thank you for this plugin and these kind of features that I looked for a long time.

    Unfortunately, I have a problem that I can't solve by myself. The plugin works fine, but when I add links who leads to a page with an article with special characters, the plugin creates an URL with those special characters. (à é è û ...).
    In french, this is very common ;)

    It works on my website, however, when I try to share the link on facebook (or simply try to generate a RSS FEED) the special characters are modified and it generates some errors.

    So, I would like to find a way to rewrite the URL without any special characters.
    I tried to find a function to help me in bp-links-core.php without success.

    Could you please help me to do this stuff ?

    Thanks a lot.

    Here to see an exemple: http://www.cemondevamal.com/articles-insolites/viré-pour-avoir-volé-10-cents-il-y-a-50-ans-7sur7-be/

    Same link generated by a copy/paste right here: http://www.cemondevamal.com/articles-insolites/vir%C3%A9-pour-avoir-vol%C3%A9-10-cents-il-y-a-50-ans-7sur7-be/

    http://wordpress.org/extend/plugins/buddypress-links/

  2. MrMaz
    Member
    Plugin Author

    Posted 1 year ago #

    That is pretty weird. The WordPress function I use to generate the slug is supposed to be converting those special characters to standard alphabet. Maybe something has changed in more recent versions, I will open a ticket and take a look soon.

  3. notsebastien
    Member
    Posted 1 year ago #

    Could you please tell me which is this wordpress function that you're talking about, and where I can find it ?

    Let me know about the ticket you posted.
    Many thanks.

  4. MrMaz
    Member
    Plugin Author

    Posted 1 year ago #

    The WordPress API function is sanitize_title_with_dashes()

    I pass the Name/Title to that function to create the slug something like this:

    $link->slug = sanitize_title_with_dashes( $name );

    I always thought that removed special characters, but WordPress has made a big push towards being 100% UTF-8 compliant for everything, so they might have backed off replacing some of the characters recently? I'm not sure.

  5. notsebastien
    Member
    Posted 1 year ago #

    Oh, interesting,
    It could be a part of a big problem that concern all the european people who works with WordPress. I'm very curious about that.

    Let us know.
    Many thanks for your investigation.

  6. MrMaz
    Member
    Plugin Author

    Posted 1 year ago #

    Its actually a VERY good thing for people who operate websites in a language with extended or accent characters. I'm sure there are no issues with a vanilla WordPress install. The problems occur when plugin authors like myself don't keep up with tweaks to the API.

    When I originally wrote the code, I copied exactly how WordPress was creating a post slug. Its apparent that has changed since I wrote it, so I need to take a look at the current code and bring it up to date.

  7. notsebastien
    Member
    Posted 1 year ago #

    Ok, so I suppose I just have to wait the next release of BuddyPress Links.
    Again, thanks for your help.

  8. MrMaz
    Member
    Plugin Author

    Posted 1 year ago #

    Just release version 0.6.6 which I believe fixes this.

    Please take a look at the pro version! Buying the pro version is the best way you can support the development of this plugin. You get some awesome additional features (like groups integration) and support to go along with it ;)

    http://shop.presscrew.com/shop/buddypress-links/

  9. notsebastien
    Member
    Posted 1 year ago #

    It works like a charm !

    Thank you very much, I will now be able to make some developments around this website project. If it's a success, I'll seriously consider to take a pro version of the plugin.

    Wish you the best for your next projects.

  10. MrMaz
    Member
    Plugin Author

    Posted 1 year ago #

    Glad it works, thanks for taking the time to help with the bug!

    I'm going to close this issue now. Good luck with your projects!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic