Ready to get started?Download WordPress


Danish characters sanitize in URL (5 posts)

  1. verify
    Posted 3 years ago #

    Hi, I have a problem with sanitizing three special Danish characters in generated URLs. These characters are "æ", "ø" and "å" and their uppercase version. When I enter some of these in post title, the character is left in URL as it is, but when I then on frontend click url with this character, it is not working.

    Anyway, on some forum I found a way to solve this, and that is adding these few lines to function remove_accents() in formatting.php right at the top under "// Decompositions for Latin-1 Supplement":

    chr(195).chr(144) => 'D', chr(195).chr(176) => 'd',
    		chr(195).chr(158) => 'TH', chr(195).chr(190) => 'th',
    		chr(195).chr(134) => 'AE', chr(195).chr(166) => 'ae',
    		chr(195).chr(133) => 'Aa', chr(195).chr(165) => 'aa',
    		chr(195).chr(152) => 'Oe', chr(195).chr(184) => 'oe',

    Still, I am modifying the core and so I would need to do this after each WordPress update. I was wondering if you could add this to a standard WordPress installation ? Thanks a lot

  2. Part of the problem is that it's stripped out because of sanitization (which prevents evil people from doing ... evil things).

    This post http://semlabs.co.uk/journal/enabling-chinese-arabic-and-other-high-unicode-in-wordpress-slugs talks about how to hack core to enable it all around.

  3. verify
    Posted 3 years ago #

    Hi Ipstenu, thanks but this is not what I was asking. When I want to hack the core, I can do it in the one file I wrote above instead of three files described in your link.

    I was asking, why do I need to hack the core, when adding this few lines only corrects danish language bug ?

  4. Like I said:

    it's stripped out because of sanitization (which prevents evil people from doing ... evil things).

    And if there was a way to do it with ONE file for ALL languages, we'd have mentioned it. But there isn't. What you've done is allow for those specific characters. If they're the only ones you need, great. :) You may find you need more, and if so you can either add them to formatting or ...

  5. verify
    Posted 3 years ago #

    Ok.. I don't understand but I think I will just .. trust you :)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.