From 019e17c040625d7ecb90cce90ae276b2a8e9daef Mon Sep 17 00:00:00 2001 From: hansemschnokeloch Date: Tue, 10 Feb 2026 16:54:51 +0100 Subject: [PATCH] Replace var_export by formatLogObject (continued) (#37188) Co-authored-by: Laurent Destailleur --- htdocs/core/class/commoninvoice.class.php | 4 ++-- htdocs/core/class/commonobject.class.php | 2 +- htdocs/includes/odtphp/odf.php | 2 +- htdocs/public/payment/newpayment.php | 6 +++--- htdocs/public/payment/paymentok.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index a0cda142714..bd29ad01358 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -1654,7 +1654,7 @@ abstract class CommonInvoice extends CommonObject $charge->customer = $customer->id; } elseif ($paymentintent->status === 'requires_action') { //paymentintent->status may be => 'requires_action' (no error in such a case) - dol_syslog(var_export($paymentintent, true), LOG_DEBUG); + dol_syslog(formatLogObject($paymentintent), LOG_DEBUG); $charge->status = 'failed'; $charge->customer = $customer->id; @@ -1665,7 +1665,7 @@ abstract class CommonInvoice extends CommonObject $stripefailuremessage = 'Action required. Contact the support at ';// . $conf->global->SELLYOURSAAS_MAIN_EMAIL; $stripefailuredeclinecode = $stripe->declinecode; } else { - dol_syslog(var_export($paymentintent, true), LOG_DEBUG); + dol_syslog(formatLogObject($paymentintent), LOG_DEBUG); $charge->status = 'failed'; $charge->customer = $customer->id; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5902557d6d5..e04b17b1a96 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3084,7 +3084,7 @@ abstract class CommonObject */ public function setPaymentTerms($id, $deposit_percent = null) { - dol_syslog(get_class($this).'::setPaymentTerms('.$id.', '.var_export($deposit_percent, true).')'); + dol_syslog(get_class($this).'::setPaymentTerms('.$id.', '.formatLogObject($deposit_percent).')'); if ($this->status >= 0 || $this->element == 'societe') { // TODO uniformize field name $fieldname = 'fk_cond_reglement'; diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php index cd8efcd481d..ae6a21a9a52 100644 --- a/htdocs/includes/odtphp/odf.php +++ b/htdocs/includes/odtphp/odf.php @@ -1019,7 +1019,7 @@ IMG; } } else { dol_syslog(get_class($this).'::exportAsAttachedPDF $ret_val='.$retval, LOG_DEBUG); - dol_syslog(get_class($this).'::exportAsAttachedPDF $output_arr='.var_export($output_arr, true), LOG_DEBUG); + dol_syslog(get_class($this).'::exportAsAttachedPDF $output_arr='.formatLogObject($output_arr), LOG_DEBUG); if ($retval == 126) { throw new OdfException('Permission execute convert script : ' . $command); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 3456b0604c1..23e259863fc 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -573,8 +573,8 @@ if ($action == 'charge' && isModEnabled('stripe')) { // Test on permission not r } dol_syslog("newpayment.php execute action = ".$action." STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION=".getDolGlobalInt('STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION'), LOG_DEBUG, 0, '_payment'); - dol_syslog("GET=".var_export($_GET, true), LOG_DEBUG, 0, '_payment'); - dol_syslog("POST=".var_export($_POST, true), LOG_DEBUG, 0, '_payment'); + dol_syslog("GET=".formatLogObject($_GET), LOG_DEBUG, 0, '_payment'); + dol_syslog("POST=".formatLogObject($_POST), LOG_DEBUG, 0, '_payment'); $stripeToken = GETPOST("stripeToken", 'alpha'); $email = GETPOST("email", 'alpha'); @@ -756,7 +756,7 @@ if ($action == 'charge' && isModEnabled('stripe')) { // Test on permission not r print('Message is:'.$err['message']."\n"); $error++; - $errormessage = "ErrorCard ".$e->getMessage()." err=".var_export($err, true); + $errormessage = "ErrorCard ".$e->getMessage()." err=".formatLogObject($err); dol_syslog($errormessage, LOG_WARNING, 0, '_payment'); setEventMessages($e->getMessage(), null, 'errors'); $action = ''; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index c64a334ddbe..c80cd1cc76a 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -524,7 +524,7 @@ $fulltag = $FULLTAG; $tmptag = dolExplodeIntoArray($fulltag, '.', '='); -dol_syslog("ispaymentok=".$ispaymentok." tmptag=".var_export($tmptag, true), LOG_DEBUG, 0, '_payment'); +dol_syslog("ispaymentok=".$ispaymentok." tmptag=".formatLogObject($tmptag), LOG_DEBUG, 0, '_payment'); // Set $appli for emails title