mirror of
https://github.com/php/php-src.git
synced 2024-09-27 21:07:25 +00:00
- Bug #49785: take 5. What the hell happened to me...
This commit is contained in:
parent
6637fd092f
commit
bbf9a7234a
@ -555,8 +555,7 @@ inline static unsigned int get_next_char(enum entity_charset charset,
|
||||
}
|
||||
this_char = ((c & 0x1f) << 6) | (str[pos + 1] & 0x3f);
|
||||
if (this_char < 0x80) {
|
||||
*status = FAILURE;
|
||||
return 0;
|
||||
MB_FAILURE(pos);
|
||||
}
|
||||
MB_WRITE((unsigned char)c);
|
||||
MB_WRITE((unsigned char)str[pos + 1]);
|
||||
|
@ -35,6 +35,12 @@ var_dump(_bin2hex(htmlentities("\xf7\xbf\xff\xbf", ENT_QUOTES, "UTF-8")));
|
||||
var_dump(_bin2hex(htmlentities("\xf7\xbf\xbf\xff", ENT_QUOTES, "UTF-8")));
|
||||
var_dump(_bin2hex(htmlentities("\xf8\x88\x80\x80\x80", ENT_QUOTES, "UTF-8")));
|
||||
|
||||
echo "--\n";
|
||||
// UTF-8: with ENT_IGNORE
|
||||
var_dump(_bin2hex(htmlentities("\xc0\xa0\xc2\x80", ENT_QUOTES | ENT_IGNORE, "UTF-8")));
|
||||
var_dump(_bin2hex(htmlentities("\xe0\x80\x80\xe0\xa0\x80", ENT_QUOTES | ENT_IGNORE, "UTF-8")));
|
||||
var_dump(_bin2hex(htmlentities("\xf0\x80\x80\x80\xf0\x90\x80\x80", ENT_QUOTES | ENT_IGNORE, "UTF-8")));
|
||||
|
||||
echo "--\n";
|
||||
// UTF-8: alternative (invalid) UTF-8 sequence
|
||||
var_dump(_bin2hex(htmlspecialchars("\xc0\xa6", ENT_QUOTES, 'UTF-8')));
|
||||
@ -155,6 +161,10 @@ string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
--
|
||||
string(4) "c280"
|
||||
string(6) "e0a080"
|
||||
string(8) "f0908080"
|
||||
--
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
string(0) ""
|
||||
|
Loading…
Reference in New Issue
Block a user