security upadtes

This commit is contained in:
Bachir Soussi Chiadmi
2017-09-25 15:16:35 +02:00
parent 650c6448e4
commit 8d8a60b615
240 changed files with 3022 additions and 1300 deletions

View File

@@ -6,7 +6,7 @@
*
*/
/*~ class.smtp.php
Orginal release information:
Original release information:
.---------------------------------------------------------------------------.
| Software: PHPMailer - PHP email class |
| Version: 5.1 |
@@ -141,7 +141,7 @@ class SMTP {
"errno" => $errno,
"errstr" => $errstr);
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": $errstr ($errno)" . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @errstr (@errno)", array("@error" => $this->error["error"], "@errstr" => $errstr, "@errno" => $errno)));
}
return FALSE;
}
@@ -155,7 +155,7 @@ class SMTP {
$announce = $this->get_lines();
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $announce . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @announce", array("@announce" => $announce)));
}
return TRUE;
@@ -184,7 +184,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 220) {
@@ -193,7 +193,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -225,7 +225,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -242,7 +242,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -259,7 +259,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -278,7 +278,7 @@ class SMTP {
if ($sock_status["eof"]) {
// the socket is valid but we are not connected
if ($this->do_debug >= 1) {
echo "SMTP -> NOTICE:" . $this->CRLF . "EOF caught while checking if connected";
drupal_set_message(t("SMTP -> NOTICE: EOF caught while checking if connected"));
}
$this->Close();
return FALSE;
@@ -314,7 +314,7 @@ class SMTP {
* finializing the mail transaction. $msg_data is the message
* that is to be send with the headers. Each header needs to be
* on a single line followed by a <CRLF> with the message headers
* and the message body being seperated by and additional <CRLF>.
* and the message body being separated by and additional <CRLF>.
*
* Implements rfc 821: DATA <CRLF>
*
@@ -343,7 +343,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 354) {
@@ -352,7 +352,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -437,7 +437,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 250) {
@@ -446,7 +446,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -502,7 +502,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 250) {
@@ -511,7 +511,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -551,7 +551,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 250) {
@@ -560,7 +560,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -594,7 +594,7 @@ class SMTP {
$byemsg = $this->get_lines();
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $byemsg . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @byemsg", array("@rply" => $byemsg)));
}
$rval = TRUE;
@@ -608,7 +608,7 @@ class SMTP {
"smtp_rply" => substr($byemsg, 4));
$rval = FALSE;
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $e["error"] . ": " . $byemsg . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
}
@@ -646,7 +646,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 250 && $code != 251) {
@@ -655,7 +655,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -689,7 +689,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 250) {
@@ -698,7 +698,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -736,7 +736,7 @@ class SMTP {
$code = substr($rply, 0, 3);
if ($this->do_debug >= 2) {
echo "SMTP -> FROM SERVER:" . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> FROM SERVER: @rply", array("@rply" => $rply)));
}
if ($code != 250) {
@@ -745,7 +745,7 @@ class SMTP {
"smtp_code" => $code,
"smtp_msg" => substr($rply, 4));
if ($this->do_debug >= 1) {
echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> ERROR: @error: @rply", array("@error" => $this->error["error"], "@rply" => $rply)));
}
return FALSE;
}
@@ -755,7 +755,7 @@ class SMTP {
/**
* This is an optional command for SMTP that this class does not
* support. This method is here to make the RFC821 Definition
* complete for this class and __may__ be implimented in the future
* complete for this class and __may__ be implemented in the future
*
* Implements from rfc 821: TURN <CRLF>
*
@@ -768,7 +768,7 @@ class SMTP {
public function Turn() {
$this->error = array("error" => "This method, TURN, of the SMTP is not implemented");
if ($this->do_debug >= 1) {
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> NOTICE: @error", array("@error" => $this->error["error"])));
}
return FALSE;
}
@@ -799,12 +799,12 @@ class SMTP {
$data = "";
while ($str = @fgets($this->smtp_conn, 515)) {
if ($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data was \"$data\"" . $this->CRLF . '<br />';
echo "SMTP -> get_lines(): \$str is \"$str\"" . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> get_lines(): \$data was \"@data\"", array("@data" => $data)));
drupal_set_message(t("SMTP -> get_lines(): \$str is \"@str\"", array("@str" => $str)));
}
$data .= $str;
if ($this->do_debug >= 4) {
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF . '<br />';
drupal_set_message(t("SMTP -> get_lines(): \$data was \"@data\"", array("@data" => $data)));
}
// if 4th character is a space, we are done reading, break the loop
if (substr($str, 3, 1) == " ") {
@@ -813,4 +813,4 @@ class SMTP {
}
return $data;
}
}
}