phpstan
This commit is contained in:
17
src/Mail.php
17
src/Mail.php
@@ -302,7 +302,7 @@ class Mail
|
|||||||
PREG_SPLIT_DELIM_CAPTURE
|
PREG_SPLIT_DELIM_CAPTURE
|
||||||
);
|
);
|
||||||
// Remove the first 2 dashes : the boundary is stored like in the headers
|
// Remove the first 2 dashes : the boundary is stored like in the headers
|
||||||
$boundary = "";
|
$boundary = $boundaryCR = "";
|
||||||
while (count($boundaryArray) > 0 && substr($boundary, 0, 2) !== "--") {
|
while (count($boundaryArray) > 0 && substr($boundary, 0, 2) !== "--") {
|
||||||
// Skip the lines until the coundary is found. The boundary start by --
|
// Skip the lines until the coundary is found. The boundary start by --
|
||||||
$boundary = array_shift($boundaryArray);
|
$boundary = array_shift($boundaryArray);
|
||||||
@@ -379,9 +379,9 @@ class Mail
|
|||||||
$headersEML = ltrim(substr($content, 0, $pos +
|
$headersEML = ltrim(substr($content, 0, $pos +
|
||||||
strlen($headerBodySeparator)));
|
strlen($headerBodySeparator)));
|
||||||
$headersArray = [];
|
$headersArray = [];
|
||||||
|
$prevCR = "";
|
||||||
if ($headersEML !== "" && $headersEML !== "--") {
|
if ($headersEML !== "" && $headersEML !== "--") {
|
||||||
$prev = "";
|
$prev = "";
|
||||||
$prevCR = "";
|
|
||||||
$headersSplit = preg_split(
|
$headersSplit = preg_split(
|
||||||
"#([\r\n]+)#",
|
"#([\r\n]+)#",
|
||||||
$headersEML,
|
$headersEML,
|
||||||
@@ -527,6 +527,7 @@ class Mail
|
|||||||
// multipart/alternative)
|
// multipart/alternative)
|
||||||
$sectionList = $this->sectionList();
|
$sectionList = $this->sectionList();
|
||||||
$sectionIDtoChange = "";
|
$sectionIDtoChange = "";
|
||||||
|
$boundary = $boundaryCR = "";
|
||||||
foreach ($sectionList as $sectionID) {
|
foreach ($sectionList as $sectionID) {
|
||||||
$section = $this->sectionGet($sectionID);
|
$section = $this->sectionGet($sectionID);
|
||||||
if (
|
if (
|
||||||
@@ -628,10 +629,10 @@ class Mail
|
|||||||
"text/html; charset=$charset",
|
"text/html; charset=$charset",
|
||||||
$sectionIDtoChange
|
$sectionIDtoChange
|
||||||
);
|
);
|
||||||
if (isset($boundary)) {
|
if ($boundary !== "") {
|
||||||
$part["_boundary"] = $boundary;
|
$part["_boundary"] = $boundary;
|
||||||
}
|
}
|
||||||
if (isset($boundaryCR)) {
|
if ($boundaryCR != "") {
|
||||||
$part["_boundaryCR"] = $boundaryCR;
|
$part["_boundaryCR"] = $boundaryCR;
|
||||||
}
|
}
|
||||||
$this->sectionUpdate($sectionIDtoChange, $part);
|
$this->sectionUpdate($sectionIDtoChange, $part);
|
||||||
@@ -654,6 +655,7 @@ class Mail
|
|||||||
// multipart/alternative)
|
// multipart/alternative)
|
||||||
$sectionList = $this->sectionList();
|
$sectionList = $this->sectionList();
|
||||||
$sectionIDtoChange = "";
|
$sectionIDtoChange = "";
|
||||||
|
$boundary = "";
|
||||||
foreach ($sectionList as $sectionID) {
|
foreach ($sectionList as $sectionID) {
|
||||||
$section = $this->sectionGet($sectionID);
|
$section = $this->sectionGet($sectionID);
|
||||||
if (
|
if (
|
||||||
@@ -736,12 +738,9 @@ class Mail
|
|||||||
"text/plain; charset=$charset",
|
"text/plain; charset=$charset",
|
||||||
$sectionIDtoChange
|
$sectionIDtoChange
|
||||||
);
|
);
|
||||||
if (isset($boundary)) {
|
if ($boundary !== "") {
|
||||||
$part["_boundary"] = $boundary;
|
$part["_boundary"] = $boundary;
|
||||||
}
|
}
|
||||||
if (isset($boundaryCR)) {
|
|
||||||
$part["_boundaryCR"] = $boundaryCR;
|
|
||||||
}
|
|
||||||
$this->sectionUpdate($sectionIDtoChange, $part);
|
$this->sectionUpdate($sectionIDtoChange, $part);
|
||||||
$this->createMailEML();
|
$this->createMailEML();
|
||||||
}
|
}
|
||||||
@@ -939,6 +938,7 @@ class Mail
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// Add the new section to the mixed section
|
// Add the new section to the mixed section
|
||||||
|
$contentID = "";
|
||||||
$sectionID = $this->sectionAddDefault();
|
$sectionID = $this->sectionAddDefault();
|
||||||
$this->sectionAddChild($sectionIDMixed, $sectionID);
|
$this->sectionAddChild($sectionIDMixed, $sectionID);
|
||||||
$finfo = new \finfo(FILEINFO_MIME);
|
$finfo = new \finfo(FILEINFO_MIME);
|
||||||
@@ -1059,6 +1059,7 @@ class Mail
|
|||||||
), $number), 404);
|
), $number), 404);
|
||||||
}
|
}
|
||||||
$part = $this->sectionGet($attachmentIDs[$number]);
|
$part = $this->sectionGet($attachmentIDs[$number]);
|
||||||
|
$res = [];
|
||||||
foreach ($part as $key => $val) {
|
foreach ($part as $key => $val) {
|
||||||
if ($key[0] === "_") {
|
if ($key[0] === "_") {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ class Tcpserver
|
|||||||
pcntl_signal(SIGTERM, [$this, "sigTERMINT"]);
|
pcntl_signal(SIGTERM, [$this, "sigTERMINT"]);
|
||||||
pcntl_signal(SIGINT, [$this, "sigTERMINT"]);
|
pcntl_signal(SIGINT, [$this, "sigTERMINT"]);
|
||||||
cli_set_process_title($this->processName . " main");
|
cli_set_process_title($this->processName . " main");
|
||||||
|
$sockServer = [];
|
||||||
foreach ($this->addresses as $key => $address) {
|
foreach ($this->addresses as $key => $address) {
|
||||||
$port = $this->ports[$key];
|
$port = $this->ports[$key];
|
||||||
if (filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
|
if (filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user