#77755debug_check_recordset returns true on $res === NULL
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:
- Fix it in place in debug_check_recordset to also return false if $res is null
- 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