| @@ 909-912 (lines=4) @@ | ||
| 906 | if ('add' == $mode) { |
|
| 907 | if (!$this->_allow_overlong && $test == 'range') { |
|
| 908 | $test = 'none'; |
|
| 909 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
|
| 910 | $this->_error('Bogus UTF-8 character detected (out of legal range) at byte ' . $k); |
|
| 911 | return false; |
|
| 912 | } |
|
| 913 | } |
|
| 914 | if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx |
|
| 915 | $v = ($v - 128) << ($next_byte * 6); |
|
| @@ 113-115 (lines=3) @@ | ||
| 110 | if ('add' == $mode) { |
|
| 111 | if (!self::$allow_overlong && $test == 'range') { |
|
| 112 | $test = 'none'; |
|
| 113 | if (($v < 0xA0 && $start_byte == 0xE0) || ($v < 0x90 && $start_byte == 0xF0) || ($v > 0x8F && $start_byte == 0xF4)) { |
|
| 114 | throw new Exception('Bogus UTF-8 character detected (out of legal range) at byte '.$k); |
|
| 115 | } |
|
| 116 | } |
|
| 117 | if ($v >> 6 == 2) { // Bit mask must be 10xxxxxx |
|
| 118 | $v = ($v-128) << ($next_byte*6); |
|