We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21255
    • 215 Posts
    The current MODx-release just strips Umlaute out of alias names instead of converting them to ’ae, oe, ue,..
    To fix it, you could apply the following patch to save_content.processor.php (line 605):

    function stripAlias($alias) { 
        global $modx;
    
        if(strtoupper($modx->config['etomite_charset'])=='UTF-8') $alias = utf8_decode($alias);
        $alias = strtr($alias, array(chr(196) => 'Ae', chr(214) => 'Oe', chr(220) => 'Ue', chr(228) => 'ae', chr(246) => 'oe', chr(252) => 'ue', chr(223) => 'ss'));
    
        $alias = strip_tags($alias); 
        //$alias = strtolower($alias); 
        $alias = preg_replace('/&.+?;/', '', $alias); // kill entities 
        $alias = preg_replace('/[^\.%A-Za-z0-9 _-]/', '', $alias); 
        $alias = preg_replace('/\s+/', '_', $alias); 
        $alias = preg_replace('|-+|', '-', $alias); 
        $alias = trim($alias, '-'); 
        return $alias; 
    } 
    

      • 7455
      • 2,204 Posts
      Nice work had to do that by hand with some aliasses indeed
      Great work

      could this be changed in the next release?
        follow me on twitter: @dimmy01
      • It will most certainly be changed if it gets submitted to the bugtracker wink
          Ryan Thrash, MODX Co-Founder
          Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
          • 4018
          • 1,131 Posts
          The real question is though...is the use of an Umlaute even legal in a URL? Reason I ask this is that alias names are mainly used to rewrite the URL. So if an umlaute isn’t a legal character to use in a URL then it’s probably not a good idea to allow for them in alias names. Just a thought.
            Jeff Whitfield

            "I like my coffee hot and strong, like I like my women, hot and strong... with a spoon in them."
          • I think the above patch replaces the umlauts with a URL-friendly alternative as opposed to allowing the umlaut to be in the URL.

            In which case, I would think this is a better alternative to stripping out the umlaut completely. smiley

            Cheers, Garry

              Garry Nutting
              Senior Developer
              MODX, LLC

              Email: [email protected]
              Twitter: @garryn
              Web: modx.com
              • 21255
              • 215 Posts
              The function should be extended to also support special characters of other languages, the French, for example.

              I wonder if there isn’t any better way to do this conversion, because the given patch won’t work with charsets other then iso-8859-1 or utf-8... Internationalization is a hairy thing wink