diff --git a/modules/articoli/actions.php b/modules/articoli/actions.php index c05a6a484..7cdabf495 100644 --- a/modules/articoli/actions.php +++ b/modules/articoli/actions.php @@ -97,9 +97,8 @@ switch (post('op')) { $contenuto = \Util\Ini::write(file_get_contents(DOCROOT.'/files/my_impianti/'.$componente), $post); $dbo->query('UPDATE mg_articoli SET contenuto='.prepare($contenuto).' WHERE id='.prepare($id_record)); - }else{ + } else { $dbo->query('UPDATE mg_articoli SET contenuto = \'\' WHERE id='.prepare($id_record)); - } // Upload file diff --git a/modules/viste/filters.php b/modules/viste/filters.php index 99440c023..4f9896080 100644 --- a/modules/viste/filters.php +++ b/modules/viste/filters.php @@ -28,7 +28,6 @@ if (!empty($additionals)) { '; - if ($editable) { echo ' diff --git a/plugins/notes.php b/plugins/notes.php index 9dabe2f60..e281447e2 100644 --- a/plugins/notes.php +++ b/plugins/notes.php @@ -2,7 +2,7 @@ include_once __DIR__.'/../core.php'; -if (count($notes)>0) { +if (count($notes) > 0) { echo '
diff --git a/src/Notifications/EmailNotification.php b/src/Notifications/EmailNotification.php index cdbf07037..33a7f7adf 100644 --- a/src/Notifications/EmailNotification.php +++ b/src/Notifications/EmailNotification.php @@ -10,7 +10,7 @@ use Uploads; class EmailNotification extends PHPMailer implements NotificationInterface { protected $mail; - protected $attachments = []; + protected $directory; protected $infos = []; @@ -168,7 +168,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface $this->SmtpClose(); // Pulizia file generati - delete(DOCROOT.'/files/notifications/'); + delete($this->getTempDirectory()); // Segnalazione degli errori if (!$result) { @@ -225,7 +225,7 @@ class EmailNotification extends PHPMailer implements NotificationInterface $print = Prints::get($print); // Utilizzo di una cartella particolare per il salvataggio temporaneo degli allegati - $path = DOCROOT.'/files/notifications/'.rand(0, 999); + $path = $this->getTempDirectory(); $info = Prints::render($print['id'], $id_record, $path); $name = $name ?: $info['name']; @@ -262,4 +262,15 @@ class EmailNotification extends PHPMailer implements NotificationInterface } } } + + protected function getTempDirectory() + { + if (!isset($this->directory)) { + $this->directory = DOCROOT.'/files/notifications/'.rand(0, 999); + + directory($this->directory); + } + + return $this->directory; + } }