Re: [RFC] New function mysqli_quote_string
| From: | Morgan | Date: | Fri, 19 Dec 2025 22:38:21 +0000 |
| Subject: | Re: [RFC] New function mysqli_quote_string | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129661@lists.php.net to get a copy of this message | ||
On 2025-12-20 04:09, Hans Henrik Bergan wrote:
btw pg_escape_literal is mis-named. it does not escape - it quotes. And there is an important difference between escaping and quoting, at least for SQLite, it is impossible to make a binary-safe escape() function, but it's fully possible to make a binary-safe quote() function (see https://github.com/php/php-src/pull/13972 <https://github.com/php/ php-src/pull/13972> ) IMO pg_escape_literal should be renamed pg_quote_literal. quote_literal() is how PostgreSQL itself names the function, and it would be consistent with PHP's functions being named to reflect those that it wraps (à la mysqli_real_escape_string()).Instead, I think it got called pg_escape_string() by symmetry with mysql_escape_string().