- MFH: add support for entities in hexadecimal format, like © can

be passed as &#169 or © (sync with gd)
This commit is contained in:
Pierre Joye 2006-08-23 20:22:31 +00:00
parent b7f2d8f17e
commit 75e9e12093
2 changed files with 24 additions and 6 deletions

2
NEWS
View File

@ -1,6 +1,8 @@
PHP NEWS PHP NEWS
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Sep 2006, PHP 5.2.0 ?? Sep 2006, PHP 5.2.0
- Added support for hexadecimal entity in imagettftext() for the bundled GD.
(Pierre)
- Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too - Fixed bug #38543 (shutdown_executor() may segfault when memory_limit is too
low). (Dmitry) low). (Dmitry)
- Fixed bug #38535 (memory corruption in pdo_pgsql driver on error retrieval - Fixed bug #38535 (memory corruption in pdo_pgsql driver on error retrieval

View File

@ -207,12 +207,28 @@ static int gdTcl_UtfToUniChar (char *str, Tcl_UniChar * chPtr)
byte = *((unsigned char *) (str + 1)); byte = *((unsigned char *) (str + 1));
if (byte == '#') { if (byte == '#') {
for (i = 2; i < 8; i++) { byte = *((unsigned char *) (str + 2));
byte = *((unsigned char *) (str + i)); if (byte == 'x' || byte == 'X') {
if (byte >= '0' && byte <= '9') { for (i = 3; i < 8; i++) {
n = (n * 10) + (byte - '0'); byte = *((unsigned char *) (str + i));
} else { if (byte >= 'A' && byte <= 'F')
break; byte = byte - 'A' + 10;
else if (byte >= 'a' && byte <= 'f')
byte = byte - 'a' + 10;
else if (byte >= '0' && byte <= '9')
byte = byte - '0';
else
break;
n = (n * 16) + byte;
}
} else {
for (i = 2; i < 8; i++) {
byte = *((unsigned char *) (str + i));
if (byte >= '0' && byte <= '9') {
n = (n * 10) + (byte - '0');
} else {
break;
}
} }
} }
if (byte == ';') { if (byte == ';') {