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

Undefined variable in imap_set.php #74

Closed
MrGauz opened this issue Apr 17, 2019 · 1 comment
Closed

Undefined variable in imap_set.php #74

MrGauz opened this issue Apr 17, 2019 · 1 comment

Comments

@MrGauz
Copy link

MrGauz commented Apr 17, 2019

I believe that the lines 224 and 225 in imap_set.php should be swapped as otherwise there is a case in which $data will be returned althought it is not set.

public function getNextLine()
{
if ( $this->hasMoreMailData )
{
if ( $this->bytesToRead !== false && $this->bytesToRead >= 0 )
{
$data = $this->connection->getLine(); // <- $data is set here
$this->bytesToRead -= strlen( $data );
if ( $this->bytesToRead <= 0 )
{
...
return $data;
}
}
return $data; // <- $data is returned outside of if although it might not be set
}
return null;
}

I believe return $data; should be inside of if statement.

@derickr
Copy link
Member

derickr commented Jan 8, 2020

I think there was a PR #73 for this, which I've just merged, so closing this report.

@derickr derickr closed this as completed Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants