Compare commits

...

2 Commits

Author SHA1 Message Date
Dominique FOURNIER
9f028ac798 FormField : property formTemplate must be public and not private (used by Form) 2023-05-15 08:38:04 +02:00
Dominique FOURNIER
7cbbec7f81 phpstan 2023-04-14 21:37:54 +02:00
3 changed files with 11 additions and 9 deletions

View File

@@ -90,7 +90,7 @@ class Formfield
/** /**
* Form template (Bootstrap3 by default) * Form template (Bootstrap3 by default)
*/ */
private $formTemplate = "Bootstrap3"; public $formTemplate = "Bootstrap3";
/** /**
* When adding a field, the name and the label are the minimum mandatory * When adding a field, the name and the label are the minimum mandatory

View File

@@ -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 (

View File

@@ -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)) {