Skip to content

Commit

Permalink
Don't set a time limit if set_time_limit is disabled, fixes PHPMailer…
Browse files Browse the repository at this point in the history
  • Loading branch information
Synchro committed Jul 20, 2020
1 parent 9ce5067 commit 9087137
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/SMTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ protected function getSMTPConnection($host, $port = null, $timeout = 30, $option
// Windows does not have support for this timeout function
if (strpos(PHP_OS, 'WIN') !== 0) {
$max = (int)ini_get('max_execution_time');
// Don't bother if unlimited
if (0 !== $max && $timeout > $max) {
// Don't bother if unlimited, or if set_time_limit is disabled
if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) {
@set_time_limit($timeout);
}
stream_set_timeout($connection, $timeout, 0);
Expand Down

0 comments on commit 9087137

Please sign in to comment.