[BUGFIX] Fix return value of DatabaseConnection::sql_free_result() 18/31718/3
authorStefano Kowalke <blueduck@gmx.net>
Tue, 22 Jul 2014 10:57:50 +0000 (12:57 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 22 Jul 2014 11:20:39 +0000 (13:20 +0200)
In case of success the current implementation returns the result
of $res->free(). Unfortunately free() doesn't return anything.
That causes sql_free_result() to return NULL, which eventually
evaluates to FALSE.

Make sure the return value is correct and
return TRUE in case of success.

Resolves: #60457
Releases: 6.2, 6.3
Change-Id: I8756d4d2a321adc88738b9ac418207c63b312c86
Reviewed-on: https://review.typo3.org/31718
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/Database/DatabaseConnection.php

index ee2e8ed..9fa3359 100644 (file)
@@ -1069,7 +1069,8 @@ class DatabaseConnection {
         */
        public function sql_free_result($res) {
                if ($this->debug_check_recordset($res) && is_object($res)) {
-                       return $res->free();
+                       $res->free();
+                       return TRUE;
                } else {
                        return FALSE;
                }