mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Boolify PDO's quoter handler
This commit is contained in:
parent
43f69160cf
commit
954d3743cc
7 changed files with 15 additions and 15 deletions
|
@ -230,12 +230,12 @@ static char *pdo_sqlite_last_insert_id(pdo_dbh_t *dbh, const char *name, size_t
|
|||
}
|
||||
|
||||
/* NB: doesn't handle binary strings... use prepared stmts for that */
|
||||
static int sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, size_t unquotedlen, char **quoted, size_t *quotedlen, enum pdo_param_type paramtype )
|
||||
static bool sqlite_handle_quoter(pdo_dbh_t *dbh, const char *unquoted, size_t unquotedlen, char **quoted, size_t *quotedlen, enum pdo_param_type paramtype )
|
||||
{
|
||||
*quoted = safe_emalloc(2, unquotedlen, 3);
|
||||
sqlite3_snprintf(2*unquotedlen + 3, *quoted, "'%q'", unquoted);
|
||||
*quotedlen = strlen(*quoted);
|
||||
return 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool sqlite_handle_begin(pdo_dbh_t *dbh)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue