From 852bc465057bec1a1588f5aa897c6e1e0da79bfd Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Wed, 26 Jul 2006 22:55:36 +0000 Subject: [PATCH] Faster remove accents. Props skeltoac. fixes #2978 git-svn-id: https://develop.svn.wordpress.org/trunk@4050 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 7735d581a4..f027869fad 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -149,6 +149,9 @@ function utf8_uri_encode( $utf8_string ) { } function remove_accents($string) { + if ( !preg_match('/[\x80-\xff]/', $string) ) + return $string; + if (seems_utf8($string)) { $chars = array( // Decompositions for Latin-1 Supplement