Skip to content

Commit d3311ff

Browse files
committed
Use the new toupper functions
Use the new ASCII upper case functions in ext/xml, ext/pdo_dblib and as an optimization for strtoupper() when the locale is "C".
1 parent 8e2448b commit d3311ff

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

ext/pdo_dblib/dblib_stmt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, zval *zv, enum pd
438438
tmp_data_len = 36;
439439
tmp_data = safe_emalloc(tmp_data_len, sizeof(char), 1);
440440
data_len = dbconvert(NULL, SQLUNIQUE, data, data_len, SQLCHAR, (LPBYTE) tmp_data, tmp_data_len);
441-
php_strtoupper(tmp_data, data_len);
441+
zend_str_toupper(tmp_data, data_len);
442442
ZVAL_STRINGL(zv, tmp_data, data_len);
443443
efree(tmp_data);
444444
} else {

ext/standard/string.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,9 @@ PHPAPI zend_string *php_string_toupper(zend_string *s)
13621362
unsigned char *c;
13631363
const unsigned char *e;
13641364

1365+
if (EXPECTED(!BG(ctype_string))) {
1366+
return zend_string_toupper(s);
1367+
}
13651368
c = (unsigned char *)ZSTR_VAL(s);
13661369
e = c + ZSTR_LEN(s);
13671370

ext/xml/xml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ static zend_string *_xml_decode_tag(xml_parser *parser, const char *tag)
611611
str = xml_utf8_decode((const XML_Char *)tag, strlen(tag), parser->target_encoding);
612612

613613
if (parser->case_folding) {
614-
php_strtoupper(ZSTR_VAL(str), ZSTR_LEN(str));
614+
zend_str_toupper(ZSTR_VAL(str), ZSTR_LEN(str));
615615
}
616616

617617
return str;

0 commit comments

Comments
 (0)