Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
janbarasek opened this issue Aug 19, 2019 · 0 comments
Closed

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

janbarasek opened this issue Aug 19, 2019 · 0 comments

Comments

@janbarasek
Copy link
Contributor

@janbarasek janbarasek commented Aug 19, 2019

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.

@dg dg closed this in 61180c1 Aug 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.