mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
ext/pdo_sqlite: PDO::sqliteCreateCollection return type strenghtening.
Is supposed to be Pdo_Sqlite::createCollation but behavior differs in regard of return type checks. close GH-18799
This commit is contained in:
parent
eac91d0453
commit
e3cfa4bcae
5 changed files with 23 additions and 6 deletions
|
@ -385,14 +385,14 @@ static int php_sqlite_collation_callback(void *context, int string1_len, const v
|
|||
zend_type_error("%s(): Return value of the collation callback must be of type int, %s returned",
|
||||
ZSTR_VAL(func_name), zend_zval_value_name(&retval));
|
||||
zend_string_release(func_name);
|
||||
zval_ptr_dtor(&retval);
|
||||
return FAILURE;
|
||||
ret = FAILURE;
|
||||
}
|
||||
if (Z_LVAL(retval) > 0) {
|
||||
ret = 1;
|
||||
} else if (Z_LVAL(retval) < 0) {
|
||||
ret = -1;
|
||||
}
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue