Project

General

Profile

Actions

Bug #77755

closed

debug_check_recordset returns true on $res === NULL

Added by Tizian Schmidlin about 8 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2016-09-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

Hello there,

I lately experienced an issue that led me to this gem in the current TYPO3 6.2 core version.

public function debug_check_recordset($res) {
        if ($res !== FALSE) {
            return TRUE;
        }
...
}

So this is quite the wrong thing to do in my opinion, since the $res might as well be null and would still be validated which leads to an issue here:

public function sql_fetch_assoc($res) {
        if ($this->debug_check_recordset($res)) {
            $result = $res->fetch_assoc(); // right here
            if ($result === NULL) {
                // Needed for compatibility
                $result = FALSE;
            }
....
I figured that there would be two ways of fixing this:
  1. Fix it in place in debug_check_recordset to also return false if $res is null
  2. Fix it in sql_fetch_assoc

I'm not sure if this is still in the current core branches but I'd like to have if fixed in the coding night, so this might just be a reminder ticket.

Regards
Tizian


Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #77671: ExtensionManager error on update repository listClosed2016-08-29

Actions
Actions

Also available in: Atom PDF