Merge branch 'PHP-8.0' into PHP-8.1

* PHP-8.0:
  Fix handling of single-key connection strings
This commit is contained in:
Christoph M. Becker 2022-06-13 14:43:03 +02:00
commit 4b8bbfb6db
No known key found for this signature in database
GPG key ID: D66C9593118BCCB6
3 changed files with 10 additions and 2 deletions

6
NEWS
View file

@ -24,6 +24,9 @@ PHP NEWS
. Backwards-compatible mappings for 0x5C/0x7E in Shift-JIS are restored,
after they had been changed in 8.1.0. (Alex Dowad)
- ODBC:
. Fixed handling of single-key connection strings. (Calvin Buckley)
- OPcache:
. Fixed bug GH-8591 (tracing JIT crash after private instance method change).
(Arnaud, Dmitry, Oleg Stepanischev)
@ -34,6 +37,9 @@ PHP NEWS
. Fixed bug #81713 (NULL byte injection in several OpenSSL functions working
with certificates). (Jakub Zelenka)
- PDO_ODBC:
. Fixed handling of single-key connection strings. (Calvin Buckley)
09 Jun 2022, PHP 8.1.7
- CLI:

View file

@ -2167,7 +2167,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;
if (uid && !strstr ((char*)db, "uid") && !strstr((char*)db, "UID")) {
spprintf(&ldb, 0, "%s;UID=%s;PWD=%s", db, uid, pwd);

View file

@ -478,7 +478,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;