-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add guard on fclose in Zend_Mail_Storage_Mbox #70
Conversation
@@ -335,7 +335,9 @@ protected function _openMboxFile($filename) | |||
*/ | |||
public function close() | |||
{ | |||
@fclose($this->_fh); | |||
if ($this->_fh && 'Unknown' !== get_resource_type($this->_fh)) { | |||
@fclose($this->_fh); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Megatherium, @falkenhawk should the @-silencer still be applied here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably keep @
just to be extra safe...
Btw, should other @fclose
in this class be similarly wrapped, or maybe $this->close()
should be used in other places? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Megatherium: Why was this specific fclose()
even addressed?
Perhaps the close()
method lacks $this->_fh = null;
to avoid errors on double close?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@falkenhawk The close()
method also resets $this->_positions
, not sure what's the side effect. but seems it's called on open sequence so probably safe to do so...
... and the other call uses private handle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think calling close instead of close resulted these failures:
will revert the commit and see :)
Looks like the problem this PR is attempting to fix is this output:
however, this doesn't reveal which test this comes from, so need to test this locally with xdebug breakpoint. |
99ab1d6
to
968a880
Compare
a41a413
to
3443f48
Compare
Signed-off-by: Elan Ruusamäe <glen@pld-linux.org>
Extracted changes made by @Megatherium from #32