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