mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fixed bug 29395 (sqlite_escape_string() returns bogus data on empty
strings). Original Patch by: Tony
This commit is contained in:
parent
e9549a4f9c
commit
fe50278d0a
1 changed files with 3 additions and 1 deletions
|
@ -2680,12 +2680,14 @@ PHP_FUNCTION(sqlite_escape_string)
|
|||
enclen = php_sqlite_encode_binary(string, stringlen, ret+1);
|
||||
RETVAL_STRINGL(ret, enclen+1, 0);
|
||||
|
||||
} else {
|
||||
} else if (stringlen) {
|
||||
ret = sqlite_mprintf("%q", string);
|
||||
if (ret) {
|
||||
RETVAL_STRING(ret, 1);
|
||||
sqlite_freemem(ret);
|
||||
}
|
||||
} else {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
}
|
||||
/* }}} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue