Kaynağa Gözat

protip: commit code before testing

smiley 10 yıl önce
ebeveyn
işleme
c5b280c18d
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      src/Util.php

+ 5 - 1
src/Util.php

@@ -62,12 +62,16 @@ class Util{
 	 */
 	 */
 	public static function isKanji($s){
 	public static function isKanji($s){
 
 
+		if(empty($s)){
+			return false;
+		}
+
 		$i = 0;
 		$i = 0;
 		$len = strlen($s);
 		$len = strlen($s);
 		while($i + 1 < $len){
 		while($i + 1 < $len){
 			$c = ((0xff&ord($s[$i])) << 8)|(0xff&ord($s[$i + 1]));
 			$c = ((0xff&ord($s[$i])) << 8)|(0xff&ord($s[$i + 1]));
 
 
-			if(!(0x8140 <= $c && $c <= 0x9FFC) && !(0xE040 <= $c && $c <= 0xEBBF)){
+			if(!($c >= 0x8140 && $c <= 0x9FFC) && !($c >= 0xE040 && $c <= 0xEBBF)){
 				return false;
 				return false;
 			}
 			}