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:
David Carlier 2025-06-07 16:35:30 +01:00
parent eac91d0453
commit e3cfa4bcae
No known key found for this signature in database
GPG key ID: 8486F847B4B94EF1
5 changed files with 23 additions and 6 deletions

View file

@ -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;