diff --git a/application/Api/v1/PreorderApicontroller.php b/application/Api/v1/PreorderApicontroller.php index 468068f6a..8197f78a1 100644 --- a/application/Api/v1/PreorderApicontroller.php +++ b/application/Api/v1/PreorderApicontroller.php @@ -830,8 +830,14 @@ class PreorderApicontroller extends mfBaseApicontroller { //$preorder_data['price_setup'] = round($product->price_setup - (($product->price_setup) / 100) * TT_PREORDER_DISCOUNT_BUSINESS); $preorder_data['price_setup'] = ($product->attributes["presales_setup_price_business"]->value) ? $product->attributes["presales_setup_price_business"]->value : $product->price_setup; } - + + if($preorder_data['price_setup']) { + $preorder_data['price_setup'] = str_replace(',', '.', $preorder_data['price_setup']); + } } + + + /* * get customer data @@ -1021,6 +1027,8 @@ class PreorderApicontroller extends mfBaseApicontroller { } if(!$preorder_id || !$preorder->ucode) { + $err_id = uniqid('err'); + $this->log->error(__METHOD__.": [$err_id] Error saving Preorder"); if($unit_changed) $unit->rollbackTransaction(); return mfResponse::InternalServerError(); } diff --git a/application/Emailnotification/Emailnotification.php b/application/Emailnotification/Emailnotification.php index 1fa645924..491567bf3 100644 --- a/application/Emailnotification/Emailnotification.php +++ b/application/Emailnotification/Emailnotification.php @@ -122,6 +122,18 @@ class Emailnotification { //$log->debug(print_r($headers, true)); $mail =& Mail::factory('mail', ["-f ".$this->email_from]); + /* + * PHP 8's mail() function now outputs proper line endings in headers (CRLF instead of LF). + * Mail_mail < 2.0 would detect a unix system and change the headers line ending to LF. + * On Mail submission to Exim (via sendmail), mail() adds its own headers first with CRLF line ending, + * making Exim treat every subsequent header's LF as an invalid line ending, adding a whitespace after the LF, + * making all our custom headers into one long header. + * + * See: https://www.exim.org/exim-html-current/doc/html/spec_html/ch-message_processing.html#SECTlineendings + * + * So we force CRLF line endings for headers here. + */ + $mail->sep = "\r\n"; $mail->send($this->email_to, $headers, $body); }