Skip to content

Commit 01e67a0

Browse files
committed
Change connection options to case insensitive
1 parent d79a62a commit 01e67a0

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

source/pdo_sqlsrv/pdo_dbh.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ struct pdo_encrypt_set_func
155155
const char TRUE_VALUE_2[] = "1";
156156
const char FALSE_VALUE_1[] = "false";
157157
const char FALSE_VALUE_2[] = "0";
158+
transform(val_str.begin(), val_str.end(), val_str.begin(), std::tolower);
158159

159160
// For backward compatibility, convert true/1 to yes and false/0 to no
160161
std::string attr;

source/shared/core_conn.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ size_t core_str_zval_is_true(_Inout_ zval* value_z)
11471147

11481148
const char TRUE_VALUE_1[] = "true";
11491149
const char TRUE_VALUE_2[] = "1";
1150+
transform(val_str.begin(), val_str.end(), val_str.begin(), std::tolower);
11501151
if (!val_str.compare(TRUE_VALUE_1) || !val_str.compare(TRUE_VALUE_2)) {
11511152
return 1; // true
11521153
}

source/sqlsrv/conn.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ struct bool_conn_str_func {
135135
{
136136
char temp_str[MAX_CONN_VALSTRING_LEN];
137137

138-
snprintf(temp_str, MAX_CONN_VALSTRING_LEN, "%s={%s};", option->odbc_name, (zend_is_true(value) ? "yes" : "no"));
138+
const char *value_str = Z_STRVAL_P(value);
139+
snprintf(temp_str, MAX_CONN_VALSTRING_LEN, "%s={%s};", option->odbc_name, (stricmp(value_str, "true") == 0 ? "yes" : "no"));
139140
conn_str += temp_str;
140141
}
141142
};

0 commit comments

Comments
 (0)