Skip to content

Commit 1969955

Browse files
authored
ext/pdo: Drop redundant mode check, and fix the first check (#17302)
1 parent dfdba3c commit 1969955

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/pdo/pdo_stmt.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode
10901090

10911091
mode = mode & ~PDO_FETCH_FLAGS;
10921092

1093-
if (mode < 0 || mode > PDO_FETCH__MAX) {
1093+
if (mode < 0 || mode >= PDO_FETCH__MAX) {
10941094
zend_argument_value_error(mode_arg_num, "must be a bitmask of PDO::FETCH_* constants");
10951095
return 0;
10961096
}
@@ -1123,10 +1123,6 @@ static bool pdo_stmt_verify_mode(pdo_stmt_t *stmt, zend_long mode, uint32_t mode
11231123
zend_argument_value_error(mode_arg_num, "must use PDO::FETCH_CLASSTYPE with PDO::FETCH_CLASS");
11241124
return 0;
11251125
}
1126-
if (mode >= PDO_FETCH__MAX) {
1127-
zend_argument_value_error(mode_arg_num, "must be a bitmask of PDO::FETCH_* constants");
1128-
return 0;
1129-
}
11301126
ZEND_FALLTHROUGH;
11311127

11321128
case PDO_FETCH_CLASS:

0 commit comments

Comments
 (0)