Skip to content

Commit

Permalink
pdo: Use zend_string_toupper in pdo_stmt_describe_columns (#16047)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TimWolla authored Sep 25, 2024
1 parent e0a7ec2 commit 3c8c0df
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions ext/pdo/pdo_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,10 @@ bool pdo_stmt_describe_columns(pdo_stmt_t *stmt) /* {{{ */
stmt->columns[col].name = zend_string_tolower(orig_name);
zend_string_release(orig_name);
break;
case PDO_CASE_UPPER: {
stmt->columns[col].name = zend_string_separate(orig_name, 0);
char *s = ZSTR_VAL(stmt->columns[col].name);
while (*s != '\0') {
*s = toupper(*s);
s++;
}
case PDO_CASE_UPPER:
stmt->columns[col].name = zend_string_toupper(orig_name);
zend_string_release(orig_name);
break;
}
EMPTY_SWITCH_DEFAULT_CASE()
}
}
Expand Down

0 comments on commit 3c8c0df

Please sign in to comment.