Skip to content

Commit

Permalink
[+]: search for the php "Segmentation fault" :/ v3
Browse files Browse the repository at this point in the history
  • Loading branch information
voku committed May 29, 2016
1 parent 682e840 commit 4331bf2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/classes/Swift/FileSpool.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ protected function getRandomString($count = null)
// This string MUST stay FS safe, avoid special chars.
$base = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-';
$ret = '';
$strlen = strlen($base) - 1;
$strlen = strlen($base);
for ($i = 0; $i < $count; ++$i) {
$ret .= $base[(int)mt_rand(0, $strlen)];
$ret .= $base[(int)mt_rand(0, $strlen - 1)];
}

return $ret;
Expand Down
4 changes: 1 addition & 3 deletions lib/classes/Swift/Transport/MailTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,10 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
$this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed');
}

$message->generateId(); // Make sure a new Message ID is used

$count = 0;
}

//$message->generateId(); // Make sure a new Message ID is used
$message->generateId(); // Make sure a new Message ID is used

return $count;
}
Expand Down
7 changes: 1 addition & 6 deletions lib/classes/Swift/Transport/SendmailTransport.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,6 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
$this->_eventDispatcher->dispatchEvent($evt, 'sendPerformed');
}

// TODO: Why do we need this only for the parameter "-f"?
// -> take a look at "AbstractSmtpTransport"
//
$message->generateId(); // Make sure a new Message ID is used

} elseif (false !== strpos($command, ' -bs')) {
$count = parent::send($message, $failedRecipients);
} else {
Expand All @@ -161,7 +156,7 @@ public function send(Swift_Mime_Message $message, &$failedRecipients = null)
);
}

//$message->generateId(); // Make sure a new Message ID is used
$message->generateId(); // Make sure a new Message ID is used

return $count;
}
Expand Down

0 comments on commit 4331bf2

Please sign in to comment.