Make WordPress Core

Ticket #23907: 23907.7.diff

File 23907.7.diff, 1.4 KB (added by tlamedia, 13 years ago)
  • tests/phpunit/tests/formatting/RemoveAccents.php

     
    9494
    9595                remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) );
    9696        }
     97
     98        public function _set_locale_to_danish() {
     99                return 'da_DK';
     100        }
     101
     102        /**
     103         * @ticket 23907
     104         */
     105        public function test_remove_danish_accents() {
     106                add_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
     107               
     108                $this->assertEquals( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) );
     109               
     110                remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) );
     111        }
     112
    97113}
  • src/wp-includes/formatting.php

     
    798798                        $chars[ chr(195).chr(156) ] = 'Ue';
    799799                        $chars[ chr(195).chr(188) ] = 'ue';
    800800                        $chars[ chr(195).chr(159) ] = 'ss';
     801                 }
     802
     803                if ( 'da_DK' === $locale ) {
     804                        $chars[ chr(195).chr(134) ] = 'Ae';
     805                        $chars[ chr(195).chr(166) ] = 'ae';
     806                        $chars[ chr(195).chr(152) ] = 'Oe';
     807                        $chars[ chr(195).chr(184) ] = 'oe';
     808                        $chars[ chr(195).chr(133) ] = 'Aa';
     809                        $chars[ chr(195).chr(165) ] = 'aa';
    801810                }
    802811
    803812                $string = strtr($string, $chars);