diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 108c2f663ad1a..464e0f0d45935 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -1995,10 +1995,10 @@ PHP_FUNCTION(odbc_result_all) } /* Start table tag */ - if (ZEND_NUM_ARGS() == 1) { - php_printf(""); - } else { + if (pv_format != NULL) { php_printf("
", pv_format); + } else { + php_printf("
"); } for (i = 0; i < result->numcols; i++) { @@ -2284,7 +2284,6 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) size_t db_len, uid_len, pwd_len; zend_long pv_opt = SQL_CUR_DEFAULT; odbc_connection *db_conn; - int cur_opt; ZEND_PARSE_PARAMETERS_START(1, 4) Z_PARAM_STRING(db, db_len) @@ -2294,19 +2293,17 @@ void odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) Z_PARAM_LONG(pv_opt) ZEND_PARSE_PARAMETERS_END(); - cur_opt = pv_opt; - - if (ZEND_NUM_ARGS() > 3) { - /* Confirm the cur_opt range */ - if (! (cur_opt == SQL_CUR_USE_IF_NEEDED || - cur_opt == SQL_CUR_USE_ODBC || - cur_opt == SQL_CUR_USE_DRIVER || - cur_opt == SQL_CUR_DEFAULT) ) { - zend_argument_value_error(4, "must be one of SQL_CUR_USE_IF_NEEDED, " - "SQL_CUR_USE_ODBC, or SQL_CUR_USE_DRIVER"); - RETURN_THROWS(); - } + if ( + pv_opt != SQL_CUR_DEFAULT + && pv_opt != SQL_CUR_USE_IF_NEEDED + && pv_opt != SQL_CUR_USE_ODBC + && pv_opt != SQL_CUR_USE_DRIVER + ) { + zend_argument_value_error(4, "must be one of SQL_CUR_USE_IF_NEEDED, " + "SQL_CUR_USE_ODBC, or SQL_CUR_USE_DRIVER"); + RETURN_THROWS(); } + int cur_opt = (int) pv_opt; if (!ODBCG(allow_persistent)) { persistent = 0;