Skip to content

Commit 4b8bbfb

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: Fix handling of single-key connection strings
2 parents 4a8c59d + 445d950 commit 4b8bbfb

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

NEWS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ PHP NEWS
2424
. Backwards-compatible mappings for 0x5C/0x7E in Shift-JIS are restored,
2525
after they had been changed in 8.1.0. (Alex Dowad)
2626

27+
- ODBC:
28+
. Fixed handling of single-key connection strings. (Calvin Buckley)
29+
2730
- OPcache:
2831
. Fixed bug GH-8591 (tracing JIT crash after private instance method change).
2932
(Arnaud, Dmitry, Oleg Stepanischev)
@@ -34,6 +37,9 @@ PHP NEWS
3437
. Fixed bug #81713 (NULL byte injection in several OpenSSL functions working
3538
with certificates). (Jakub Zelenka)
3639

40+
- PDO_ODBC:
41+
. Fixed handling of single-key connection strings. (Calvin Buckley)
42+
3743
09 Jun 2022, PHP 8.1.7
3844

3945
- CLI:

ext/odbc/php_odbc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,8 @@ int odbc_sqlconnect(odbc_connection **conn, char *db, char *uid, char *pwd, int
21672167
char *ldb = 0;
21682168
int ldb_len = 0;
21692169

2170-
if (strstr((char*)db, ";")) {
2170+
/* a connection string may have = but not ; - i.e. "DSN=PHP" */
2171+
if (strstr((char*)db, "=")) {
21712172
direct = 1;
21722173
if (uid && !strstr ((char*)db, "uid") && !strstr((char*)db, "UID")) {
21732174
spprintf(&ldb, 0, "%s;UID=%s;PWD=%s", db, uid, pwd);

ext/pdo_odbc/odbc_driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ static int pdo_odbc_handle_factory(pdo_dbh_t *dbh, zval *driver_options) /* {{{
478478
goto fail;
479479
}
480480

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

0 commit comments

Comments
 (0)