-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Uncaught TypeError: stream_set_timeout(): Argument #1 ($stream) must be of type resource, bool given #4679
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…more recently (#4479) * Threaded Mode Can't get back to old threads if sorted more recently From report here: https://community.mybb.com/thread-234049.html * Remove redundant check
…and to conform `mysql`'s.
…nd scale for PostgreSQL.
Thank you @yuliu Tested, works fine with one minor change. Also fixed the indentation :)
…stence in `column_default` for `DB_PgSQL` and `PostgresPdoDbDriver`, rather than the field's primary key.
Remove <strong></strong> from lang file
Fix the space between checkbox and text
* Removes query part in SQLite's `optimize_table()` that causes errors. * Refines comments.
Fixes #4512 - forumdisplay_forumsort template is not cached
Fixes #4504 - Twitch video code
…for IP columns (#4552)
…rums()` in `/inc/functions_search.php`.
…> Groups > Join Requests for 'X'.
…osts > Moderation Queue > Posts Awaiting Moderation and Attachments Awaiting Moderation.
…intenance > System Email Log, User Email Log, and Statistics (> Overall Statistics).
…ad()` for possible repeatedly loading language files.
…plugin hooks in `my_mail()` and `get_my_mailhandler()`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to establish the SMTP connection, the code assumes that the socket being obtained is a valid one, and performs a call to set the stream_set_timeout. That's correct for a successful connection, however if a connection cannot be established the call to fsockopen returns a boolean FALSE which leads to an exception when trying to call the @stream_set_timeout function since it expects a handle rather than a boolean, leading to the below stacktrace and exception:
The snippet of code that fails is as below
`(Line 281) of inc/mailhandlers/smtp.php
function connect()
{
global $lang, $mybb;
`
The solution is to check the handle being returned, and in case of getting a FALSE boolean, we should immediately log the condition and return from the function with a FALSE flagging that something has failed while trying to send the mail via SMTP.
The snippet below represents one potential way to fix this issue
`function connect()
{
global $lang, $mybb;
Said that, this is not the only change required since after doing so, the user is sent a positive notification on the screen , rather than a message indicating that something went wrong, i'm afraid more work is required in the upstream call chain so that when a FALSE is returned it must be interpreted as a failure and some action taken. I didn't dig too much yet but i think these changes should be incorporated to turn the mail process robust enough. ( it seems quite rough for now )