Files
php-src/main/php_odbc_utils.h
Calvin Buckley 0d9ff00394 ext/odbc: Get the exact length for quoted connection string components (#21892)
* ext/odbc: get exact length for quoted connection strings

strlen has to scan the string until the end of the null terminator, we
might as well do the same but scan for end quotes that need escaping.

* ext/odbc: rename function now that it gets the exact length rather than an estimate
2026-04-29 11:00:01 -03:00

21 lines
1.1 KiB
C

/*
+----------------------------------------------------------------------+
| Copyright © The PHP Group and Contributors. |
+----------------------------------------------------------------------+
| This source file is subject to the Modified BSD License that is |
| bundled with this package in the file LICENSE, and is available |
| through the World Wide Web at <https://www.php.net/license/>. |
| |
| SPDX-License-Identifier: BSD-3-Clause |
+----------------------------------------------------------------------+
| Authors: Calvin Buckley <calvin@cmpct.info> |
+----------------------------------------------------------------------+
*/
#include "php.h"
PHPAPI bool php_odbc_connstr_is_quoted(const char *str);
PHPAPI bool php_odbc_connstr_should_quote(const char *str);
PHPAPI size_t php_odbc_connstr_get_quoted_length(const char *in_str);
PHPAPI size_t php_odbc_connstr_quote(char *out_str, const char *in_str, size_t out_str_size);