• 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

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

    This post https://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.

    Thread Starter Jan Zikmund

    (@verify)

    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 ?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    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 …

    Thread Starter Jan Zikmund

    (@verify)

    Ok.. I don’t understand but I think I will just .. trust you ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Danish characters sanitize in URL’ is closed to new replies.