Skip to content

Debugger::errorHandler() argument $context can be null #379

@janbarasek

Description

@janbarasek

Version: 2.6.4

Bug Description

In case of imap_* function error, for example: Unknown: UID sequence range invalid (errflg=2) Tracy can not log it.

I noticed that definition of Debugger::errorHandler, parameter $context must be array, but in this specific case are given arguments in special case.

I tried dump it:

/**
 * Handler to catch warnings and notices.
 * @return bool|null   false to call normal error handler, null otherwise
 * @throws ErrorException
 * @internal
 */
public static function errorHandler(int $severity, string $message, string $file, int $line, $context = []): ?bool
{
	if (\is_array($context) === false) {
		echo Dumper::toHtml($context);
		echo Dumper::toHtml([
			'severity' => $severity,
			'message' => $message,
			'file' => $file,
			'line' => $line,
			'content' => $context,
		]);
	}

so in this case parameter $context is null and file and line is unknown.

Snímek obrazovky 2019-08-19 v 11 15 39

I caused an error while trying to run old codes from this page: https://php.vrana.cz/zobrazeni-posty-na-webu.php

Steps To Reproduce

Simply call function imap_fetch_overview with invalid $sequence (second parameter).

For instance:

$imap = imap_open($root, $login, $password, OP_HALFOPEN);
imap_fetch_overview($imap, '1:0', FT_UID)

In variable $imap is valid imap resource created by imap_open().

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions