From ff7052803160ab45b77067e57a6f6774b1e344e1 Mon Sep 17 00:00:00 2001 From: Cris Higham Date: Tue, 5 Sep 2023 17:59:08 +0200 Subject: [PATCH 1/3] Messaging debug message in the wrong place Debug message is in the wrong place --- Tina4/Messaging/Messenger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tina4/Messaging/Messenger.php b/Tina4/Messaging/Messenger.php index f944c72c..ddef251b 100644 --- a/Tina4/Messaging/Messenger.php +++ b/Tina4/Messaging/Messenger.php @@ -85,7 +85,6 @@ final public function sendEmail($recipients, string $subject, $message, string $ file_put_contents($_SERVER["DOCUMENT_ROOT"] . "/messenger/spool/email_" . date("d_m_Y_h_i_s") . ".eml", $headers . $message); if (!$this->settings->usePHPMailer) { - Debug::message("Sending email using PHP mail"); $message = $this->prepareHtmlMail($message, $eol, "--" . $boundary_rel, "--" . $boundary_alt); if (!empty($this->settings->smtpPort)) { @@ -105,6 +104,7 @@ final public function sendEmail($recipients, string $subject, $message, string $ die("Install PHP Mailer -
composer require phpmailer/phpmailer
"); } else { + Debug::message("Sending email using PHP mail"); $phpMailer = new \PHPMailer\PHPMailer\PHPMailer(true); try { ob_start(); From e77cddc588ec0db03ae6fdd1d23ed8761b719b5f Mon Sep 17 00:00:00 2001 From: Cris Higham Date: Tue, 5 Sep 2023 18:35:19 +0200 Subject: [PATCH 2/3] Documentation on Messenger The recipients array actually needs an array of arrays --- Tina4/Messaging/Messenger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tina4/Messaging/Messenger.php b/Tina4/Messaging/Messenger.php index ddef251b..f71ea780 100644 --- a/Tina4/Messaging/Messenger.php +++ b/Tina4/Messaging/Messenger.php @@ -37,7 +37,7 @@ public function __construct(MessengerSettings $settings = null) * * The sendMail function takes on a number of params and sends and email to a receipient. * - * @param mixed $recipients array This can be a String or Array, the String should be ; delimited email@test.com;emai2@test2.com or ["name" => "Test", "email" => "email@email.com"] + * @param mixed $recipients array This can be a String or Array of Arrays, the String should be ; delimited email@test.com;emai2@test2.com or [["name" => "Test", "email" => "email@email.com"],["name" => "Test Two", "email" => "noone@nowhere.com"]] * @param string $subject The subject for the email * @param mixed $message array/string The message to send to the Receipient - can be ["template" => "twigFile", "data" => Array or Object] * @param string $fromName The name of the person sending the message From 845c6517f8e110bc26c42df2a3128e02a331f34f Mon Sep 17 00:00:00 2001 From: Cris Higham Date: Fri, 8 Sep 2023 21:58:07 +0200 Subject: [PATCH 3/3] Static route is broken path separator being used instead of the directory separator --- Tina4/Routing/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tina4/Routing/Router.php b/Tina4/Routing/Router.php index d465db24..71d650dc 100644 --- a/Tina4/Routing/Router.php +++ b/Tina4/Routing/Router.php @@ -93,7 +93,7 @@ final public function resolveRoute(?string $method, ?string $url, ?Config $confi //SECOND STATIC FILES - ONLY GET if ($method === TINA4_GET) { - $fileName = realpath(TINA4_DOCUMENT_ROOT . PATH_SEPARATOR."src".PATH_SEPARATOR."public".$url); //The most obvious request + $fileName = realpath(TINA4_DOCUMENT_ROOT . DIRECTORY_SEPARATOR . "src" . DIRECTORY_SEPARATOR . "public" . $url); //The most obvious request if (file_exists($fileName) && $routerResponse = $this->returnStatic($fileName)) { Debug::message("$this->GUID GET - " . $fileName, TINA4_LOG_DEBUG); if (defined("TINA4_CACHED_ROUTES") && strpos(print_r(TINA4_CACHED_ROUTES, 1), $url) !== false) {