mirror of
https://github.com/php/php-src.git
synced 2024-11-30 21:35:36 +08: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
@ -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…
Reference in New Issue
Block a user