mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
2920a26636
Because the UID= and PWD= values are appended to the SQLDriverConnect case when credentials are passed, we have to append them to the string in case users are relying on this behaviour. However, they must be quoted, or the arguments will be invalid (or possibly more injected). This means users had to quote arguments or append credentials to the raw connection string themselves. It seems that ODBC quoting rules are consistent enough (and that Microsoft trusts them enough to encode into the .NET BCL) that we can actually check if the string is already quoted (in case a user is already quoting because of this not being fixed), and if not, apply the appropriate ODBC quoting rules. This is because the code exists in main/, and are shared between both ODBC extensions, so it doesn't make sense for it to only exist in one or the other. There may be a better spot for it. Closes GH-8307.
22 lines
964 B
JavaScript
22 lines
964 B
JavaScript
// vim:ft=javascript
|
|
|
|
ARG_ENABLE("odbc", "ODBC support", "no");
|
|
ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is expected, default 0x0350. Use the special value of 0 to prevent an explicit ODBCVER to be defined.", "0x0350");
|
|
|
|
if (PHP_ODBC == "yes") {
|
|
if (CHECK_LIB("odbc32.lib", "odbc") && CHECK_LIB("odbccp32.lib", "odbc")
|
|
&& CHECK_HEADER_ADD_INCLUDE("sql.h", "CFLAGS_ODBC")
|
|
&& CHECK_HEADER_ADD_INCLUDE("sqlext.h", "CFLAGS_ODBC")) {
|
|
EXTENSION("odbc", "php_odbc.c odbc_utils.c", PHP_ODBC_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
|
|
AC_DEFINE("HAVE_UODBC", 1, "ODBC support");
|
|
if ("no" == PHP_ODBCVER) {
|
|
AC_DEFINE("ODBCVER", "0x0350", "The highest supported ODBC version", false);
|
|
} else if ("0" != PHP_ODBCVER) {
|
|
AC_DEFINE("ODBCVER", PHP_ODBCVER, "The highest supported ODBC version", false);
|
|
}
|
|
} else {
|
|
WARNING("odbc support can't be enabled, libraries or header are missing (SDK)")
|
|
PHP_ODBC = "no"
|
|
}
|
|
}
|