1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

Merge branch 'ticket/17142' into ticket/17142-master

This commit is contained in:
rxu
2023-06-08 10:20:24 +07:00
12 changed files with 123 additions and 57 deletions

View File

@@ -1331,4 +1331,21 @@ abstract class driver implements driver_interface
return $rows_total;
}
/**
* {@inheritDoc}
*/
public function clean_query_id($query_id)
{
// Some DBMS functions accept/return objects and/or resources instead if identifiers
// Attempting to use objects/resources as array keys will throw error, hence correctly handle all cases
if (is_resource($query_id))
{
return function_exists('get_resource_id') ? get_resource_id($query_id) : (int) $query_id;
}
else
{
return is_object($query_id) ? spl_object_id($query_id) : $query_id;
}
}
}