mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Incorrect case close operands
This commit is contained in:
parent
2e092c7bd4
commit
a978ae260a
7 changed files with 22 additions and 19 deletions
|
@ -3072,21 +3072,21 @@ class utf8
|
|||
} #speed improve
|
||||
|
||||
switch (strlen($char)) {
|
||||
case 1 :
|
||||
case 1:
|
||||
return $cache[$char] = ord($char);
|
||||
case 2 :
|
||||
case 2:
|
||||
return $cache[$char] = (ord($char{1}) & 63) |
|
||||
((ord($char{0}) & 31) << 6);
|
||||
case 3 :
|
||||
case 3:
|
||||
return $cache[$char] = (ord($char{2}) & 63) |
|
||||
((ord($char{1}) & 63) << 6) |
|
||||
((ord($char{0}) & 15) << 12);
|
||||
case 4 :
|
||||
case 4:
|
||||
return $cache[$char] = (ord($char{3}) & 63) |
|
||||
((ord($char{2}) & 63) << 6) |
|
||||
((ord($char{1}) & 63) << 12) |
|
||||
((ord($char{0}) & 7) << 18);
|
||||
default :
|
||||
default:
|
||||
trigger_error('Character 0x' . bin2hex($char) . ' is not UTF-8!', E_USER_WARNING);
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue