Skip to content

A connection string may contain just a single key #8748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2170,7 +2170,8 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
char *ldb = 0;
int ldb_len = 0;

if (strstr((char*)db, ";")) {
/* a connection string may have = but not ; - i.e. "DSN=PHP" */
if (strstr((char*)db, "=")) {
direct = 1;
/* Force UID and PWD to be set in the DSN */
bool is_uid_set = uid && *uid
Expand Down
3 changes: 2 additions & 1 deletion ext/pdo_odbc/odbc_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
goto fail;
}

if (strchr(dbh->data_source, ';')) {
/* a connection string may have = but not ; - i.e. "DSN=PHP" */
if (strchr(dbh->data_source, '=')) {
SQLCHAR dsnbuf[1024];
SQLSMALLINT dsnbuflen;

Expand Down