summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/utf8.php7
1 files changed, 2 insertions, 5 deletions
diff --git a/inc/utf8.php b/inc/utf8.php
index e2f016942..85e5f4f7e 100644
--- a/inc/utf8.php
+++ b/inc/utf8.php
@@ -62,13 +62,10 @@ if(!function_exists('utf8_isASCII')){
/**
* Checks if a string contains 7bit ASCII only
*
- * @author Andreas Gohr <andi@splitbrain.org>
+ * @author Andreas Haerter <netzmeister@andreas-haerter.de>
*/
function utf8_isASCII($str){
- for($i=0; $i<strlen($str); $i++){
- if(ord($str{$i}) >127) return false;
- }
- return true;
+ return (preg_match('/(?:[^\x00-\x7F])/', $str) !== 1);
}
}