diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 819b0b73fa..796a3c8504 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -812,6 +812,13 @@ function remove_accents($string) { $chars[ chr(195).chr(156) ] = 'Ue'; $chars[ chr(195).chr(188) ] = 'ue'; $chars[ chr(195).chr(159) ] = 'ss'; + } elseif ( 'da_DK' === $locale ) { + $chars[ chr(195).chr(134) ] = 'Ae'; + $chars[ chr(195).chr(166) ] = 'ae'; + $chars[ chr(195).chr(152) ] = 'Oe'; + $chars[ chr(195).chr(184) ] = 'oe'; + $chars[ chr(195).chr(133) ] = 'Aa'; + $chars[ chr(195).chr(165) ] = 'aa'; } $string = strtr($string, $chars); diff --git a/tests/phpunit/tests/formatting/RemoveAccents.php b/tests/phpunit/tests/formatting/RemoveAccents.php index ca8c503ab4..a1a85e1bb9 100644 --- a/tests/phpunit/tests/formatting/RemoveAccents.php +++ b/tests/phpunit/tests/formatting/RemoveAccents.php @@ -94,4 +94,20 @@ class Tests_Formatting_RemoveAccents extends WP_UnitTestCase { remove_filter( 'locale', array( $this, '_remove_accents_germanic_umlauts_cb' ) ); } + + public function _set_locale_to_danish() { + return 'da_DK'; + } + + /** + * @ticket 23907 + */ + public function test_remove_danish_accents() { + add_filter( 'locale', array( $this, '_set_locale_to_danish' ) ); + + $this->assertEquals( 'AeOeAaaeoeaa', remove_accents( 'ÆØÅæøå' ) ); + + remove_filter( 'locale', array( $this, '_set_locale_to_danish' ) ); + } + }