From 1211961325ed83c2ea898c2d47a18380e532c0dc Mon Sep 17 00:00:00 2001 From: Matteo Baccan Date: Mon, 14 Sep 2020 12:41:00 +0200 Subject: Update mysql.php After PHPStan analysis: 1) mysql_get_client_info : use global resource link 2) mysqli_free_result : have a void return and mysql_free_result a bool return. These functions have not a compatible return. Changed to TRUE the result --- mysql.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql.php b/mysql.php index d3824fb..30fbe7f 100644 --- a/mysql.php +++ b/mysql.php @@ -272,7 +272,9 @@ if (!extension_loaded('mysql') && !function_exists('mysql_connect')) { */ function mysql_get_client_info() { - return mysqli_get_client_info(); + global $__MYSQLI_WRAPPER_LINK; + // Better use the reference to current connection + return mysqli_get_client_info($__MYSQLI_WRAPPER_LINK); } /** @@ -281,7 +283,9 @@ if (!extension_loaded('mysql') && !function_exists('mysql_connect')) { */ function mysql_free_result(mysqli_result $result) { - return mysqli_free_result($result); + // mysqli_free_result have a void return + mysqli_free_result($result); + return TRUE; } /** -- cgit v1.1