Skip to content

Commit 3c8c0df

Browse files
authored
pdo: Use zend_string_toupper in pdo_stmt_describe_columns (#16047)
zend_string_toupper was only introduced in PHP 8.2 and thus it likely was not used here, since this code was last touched for PHP 8.0.
1 parent e0a7ec2 commit 3c8c0df

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,10 @@ bool pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
144144
stmt->columns[col].name = zend_string_tolower(orig_name);
145145
zend_string_release(orig_name);
146146
break;
147-
case PDO_CASE_UPPER: {
148-
stmt->columns[col].name = zend_string_separate(orig_name, 0);
149-
char *s = ZSTR_VAL(stmt->columns[col].name);
150-
while (*s != '\0') {
151-
*s = toupper(*s);
152-
s++;
153-
}
147+
case PDO_CASE_UPPER:
148+
stmt->columns[col].name = zend_string_toupper(orig_name);
149+
zend_string_release(orig_name);
154150
break;
155-
}
156151
EMPTY_SWITCH_DEFAULT_CASE()
157152
}
158153
}

0 commit comments

Comments
 (0)