From 0d3e0c8ec47e65b23577d36f96427e8737c1f27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 12 Jan 2024 20:40:34 +0100 Subject: [PATCH] fix incorrect case and remove exclude check (#27449) --- htdocs/accountancy/admin/card.php | 2 +- htdocs/accountancy/admin/categories.php | 2 +- htdocs/adherents/card.php | 2 +- htdocs/adherents/class/adherent.class.php | 6 +++--- htdocs/admin/agenda_other.php | 4 ++-- htdocs/admin/agenda_reminder.php | 4 ++-- htdocs/admin/security_other.php | 4 ++-- htdocs/blockedlog/admin/blockedlog.php | 2 +- htdocs/comm/action/rapport/index.php | 2 +- htdocs/compta/bank/document.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- .../prelevement/class/bonprelevement.class.php | 18 +++++++++--------- htdocs/compta/resultat/result.php | 2 +- htdocs/contact/card.php | 4 ++-- htdocs/core/class/dolgraph.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/html.formother.class.php | 4 ++-- htdocs/core/class/smtps.class.php | 4 ++-- htdocs/core/class/vcard.class.php | 2 +- htdocs/core/customreports.php | 14 +++++++------- htdocs/core/lib/barcode.lib.php | 6 +++--- htdocs/core/lib/images.lib.php | 4 ++-- htdocs/core/modules/mailings/pomme.modules.php | 2 +- .../modules/mailings/xinputfile.modules.php | 2 +- .../modules/mailings/xinputuser.modules.php | 2 +- htdocs/cron/card.php | 2 +- .../class/emailcollector.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/expensereport/card.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 2 +- htdocs/holiday/list.php | 2 +- htdocs/imports/import.php | 2 +- htdocs/modulebuilder/admin/setup.php | 2 +- htdocs/modulebuilder/index.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/fournisseurs.php | 2 +- htdocs/product/list.php | 2 +- htdocs/product/stock/massstockmove.php | 2 +- .../product/stock/tpl/stockcorrection.tpl.php | 2 +- htdocs/public/company/new.php | 2 +- .../public/eventorganization/attendee_new.php | 6 +++--- htdocs/public/members/new.php | 2 +- htdocs/public/partnership/new.php | 2 +- htdocs/public/payment/newpayment.php | 4 ++-- htdocs/public/project/new.php | 2 +- htdocs/public/project/suggestbooth.php | 4 ++-- htdocs/public/project/suggestconference.php | 2 +- .../recruitmentcandidature_card.php | 2 +- htdocs/resource/card.php | 6 +++--- htdocs/societe/card.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/ticket/card.php | 2 +- htdocs/ticket/contact.php | 2 +- htdocs/user/class/user.class.php | 4 ++-- phpstan_action.neon | 2 +- 55 files changed, 87 insertions(+), 87 deletions(-) diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 48d7d86e89f..4958f17fdf7 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -217,7 +217,7 @@ $title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card'); $help_url = 'EN:Category:Accounting'; -llxheader('', $title, $help_url); +llxHeader('', $title, $help_url); // Create mode diff --git a/htdocs/accountancy/admin/categories.php b/htdocs/accountancy/admin/categories.php index 014de28bcf3..bd196fb710a 100644 --- a/htdocs/accountancy/admin/categories.php +++ b/htdocs/accountancy/admin/categories.php @@ -113,7 +113,7 @@ if ($action == 'delete') { $form = new Form($db); $formaccounting = new FormAccounting($db); -llxheader('', $langs->trans('AccountingCategory')); +llxHeader('', $langs->trans('AccountingCategory')); $linkback = ''.$langs->trans("BackToList").''; $titlepicto = 'setup'; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 4ecdad298ff..224c25c23b6 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -563,7 +563,7 @@ if (empty($reshook)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors'); } - if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($email)) { + if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($email)) { $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors'); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 464f7e8afab..95ed150e696 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -586,7 +586,7 @@ class Adherent extends CommonObject $this->import_key = trim($this->import_key); // Check parameters - if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($this->email)) { + if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($this->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->email); return -1; @@ -730,7 +730,7 @@ class Adherent extends CommonObject $this->url = $this->url ? clean_url($this->url, 0) : ''; $this->setUpperOrLowerCase(); // Check parameters - if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($this->email)) { + if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($this->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->email); return -1; @@ -1705,7 +1705,7 @@ class Adherent extends CommonObject $insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, '', $user, $emetteur_nom, $emetteur_banque); if ($insertid > 0) { - $inserturlid = $acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/card.php?rowid=', $this->getFullname($langs), 'member'); + $inserturlid = $acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/card.php?rowid=', $this->getFullName($langs), 'member'); if ($inserturlid > 0) { // Update table subscription $sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET fk_bank=".((int) $insertid); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index d29ab9b0b5f..772bc0efa6a 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -64,7 +64,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; $value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); @@ -74,7 +74,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 766b8222ed6..fa4dd0df9a1 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -55,7 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; $value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); @@ -65,7 +65,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 9f84ed56668..74c3894a21b 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -48,7 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; $value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1); if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); @@ -56,7 +56,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) { } elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) { $code = $reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index 75acdf7b230..5fea2e31382 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -66,7 +66,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) { if (preg_match('/del_(.*)/', $action, $reg)) { $code = $reg[1]; if (dolibarr_del_const($db, $code, 0) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"].($withtab ? '?withtab='.$withtab : '')); + header("Location: ".$_SERVER["PHP_SELF"].($withtab ? '?withtab='.$withtab : '')); exit; } else { dol_print_error($db); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index ed6a3f8ed9e..5ef15ca226a 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -58,7 +58,7 @@ if (!$sortfield) { // Security check //$result = restrictedArea($user, 'agenda', 0, '', 'myactions'); if (!$user->hasRight("agenda", "allactions", "read")) { - accessForbidden(); + accessforbidden(); } diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php index 0960b984c04..522b2d56939 100644 --- a/htdocs/compta/bank/document.php +++ b/htdocs/compta/bank/document.php @@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) { dol_print_error($db); } } else { - Header('Location: index.php'); + header('Location: index.php'); exit; } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1d890c8805c..17b64381d86 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3242,7 +3242,7 @@ class Facture extends CommonInvoice } else { if ($key == 'EMAIL') { // Check for mandatory - if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEMail($this->thirdparty->email)) { + if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEmail($this->thirdparty->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index dd168084957..31a5893185d 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -2084,7 +2084,7 @@ class BonPrelevement extends CommonObject fputs($this->file, substr(strtoupper($client_nom)." ", 0, 24)); // Domiciliation facultative D1 - $domiciliation = strtr($rib_dom, array(" " => "-", CHR(13) => " ", CHR(10) => "")); + $domiciliation = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => "")); fputs($this->file, substr($domiciliation." ", 0, 24)); // Zone Reservee D2 @@ -2189,8 +2189,8 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).''.$CrLf; $XML_DEBITOR .= ' '.$CrLf; $XML_DEBITOR .= ' '.$row_country_code.''.$CrLf; - $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); if (trim($addressline1)) { $XML_DEBITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } @@ -2258,8 +2258,8 @@ class BonPrelevement extends CommonObject $XML_CREDITOR .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).''.$CrLf; $XML_CREDITOR .= ' '.$CrLf; $XML_CREDITOR .= ' '.$row_country_code.''.$CrLf; - $addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => "")); if (trim($addressline1)) { $XML_CREDITOR .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } @@ -2436,8 +2436,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); if ($addressline1) { $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } @@ -2502,8 +2502,8 @@ class BonPrelevement extends CommonObject $XML_SEPA_INFO .= ' '.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).''.$CrLf; $XML_SEPA_INFO .= ' '.$CrLf; $XML_SEPA_INFO .= ' '.$country[1].''.$CrLf; - $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => "")); - $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => "")); + $addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => "")); + $addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => "")); if ($addressline1) { $XML_SEPA_INFO .= ' '.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).''.$CrLf; } diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index c1ace761438..653c14b49e6 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -182,7 +182,7 @@ $months = array( $langs->trans("MonthShort12"), ); -llxheader('', $langs->trans('ReportInOut')); +llxHeader('', $langs->trans('ReportInOut')); $formaccounting = new FormAccounting($db); $form = new Form($db); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 1f3aa963476..ac1bc28ac0b 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -257,7 +257,7 @@ if (empty($reshook)) { $action = 'create'; } - if (!empty($object->email) && !isValidEMail($object->email)) { + if (!empty($object->email) && !isValidEmail($object->email)) { $langs->load("errors"); $error++; $errors[] = $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha')); @@ -348,7 +348,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (!empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)) && !isValidEMail(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (!empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)) && !isValidEmail(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $langs->load("errors"); $error++; $errors[] = $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha')); diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 168c9c8063b..cc1338842f8 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -1342,7 +1342,7 @@ class DolGraph if (empty($showlegend)) { $this->stringtoshow .= 'legend: { display: false }, '."\n"; } else { - $this->stringtoshow .= 'legend: { maxWidth: '.round(intVal($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n"; + $this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n"; } if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) { $this->stringtoshow .= 'tooltip: { mode: \'nearest\', diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 9735e5d4571..17c89cbe2d2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -792,7 +792,7 @@ class FormMail extends Form // Ask delivery receipt if (!empty($this->withdeliveryreceipt) && getDolGlobalInt('MAIN_EMAIL_SUPPORT_ACK')) { - $out .= $this->getHtmlForDeliveryReceipt(); + $out .= $this->getHtmlForDeliveryreceipt(); } // Topic diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 21a7a67dc3f..7203748ae53 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1014,8 +1014,8 @@ class FormOther //print $rouge.$vert.$bleu; imagefill($image, 0, 0, $couleur); //on remplit l'image // On cree la couleur et on l'attribue a une variable pour ne pas la perdre - ImagePng($image, $file); //renvoie une image sous format png - ImageDestroy($image); + imagepng($image, $file); //renvoie une image sous format png + imagedestroy($image); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 5291d3d9e02..b9088775c91 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -382,7 +382,7 @@ class SMTPs public function buildRCPTlist() { // Pull TO list - $_aryToList = $this->getTO(); + $_aryToList = $this->getTo(); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1425,7 +1425,7 @@ class SMTPs global $conf; $_header = 'From: '.$this->getFrom('org')."\r\n" - . 'To: '.$this->getTO()."\r\n"; + . 'To: '.$this->getTo()."\r\n"; if ($this->getCC()) { $_header .= 'Cc: '.$this->getCC()."\r\n"; diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index e2694520577..683c8f072bc 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -396,7 +396,7 @@ class vCard $this->setProdId('Dolibarr '.DOL_VERSION); - $this->setUid('DOLIBARR-USERID-'.dol_trunc(md5('vcard'.$dolibarr_main_instance_unique_id), 8, 'right', 'UTF-8', 1).'-'.$object->id); + $this->setUID('DOLIBARR-USERID-'.dol_trunc(md5('vcard'.$dolibarr_main_instance_unique_id), 8, 'right', 'UTF-8', 1).'-'.$object->id); $this->setName($object->lastname, $object->firstname, "", $object->civility_code, ""); $this->setFormattedName($object->getFullName($langs, 1)); diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index ff288424d37..55c241fc290 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -1047,7 +1047,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu // Add main fields of object foreach ($object->fields as $key => $val) { if (!empty($val['isameasure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofmesures[$tablealias.'.'.$key.'-sum'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' ('.$langs->trans("Sum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1200,7 +1200,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, continue; } if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofxaxis[$tablealias.'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1223,7 +1223,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, 'tablefromt' => $tablepath ); } else { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofxaxis[$tablealias.'.'.$key] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']), 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1246,7 +1246,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, } if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('timestamp', 'date', 'datetime'))) { - $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intVal($extrafields->attributes[$object->table_element]['pos'][$key])); + $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intval($extrafields->attributes[$object->table_element]['pos'][$key])); $arrayofxaxis[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), @@ -1362,7 +1362,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup continue; } if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofgroupby[$tablealias.'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1385,7 +1385,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup 'tablefromt' => $tablepath ); } else { - $position = (empty($val['position']) ? 0 : intVal($val['position'])); + $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofgroupby[$tablealias.'.'.$key] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']), 'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']), @@ -1408,7 +1408,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup } if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('timestamp', 'date', 'datetime'))) { - $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intVal($extrafields->attributes[$object->table_element]['pos'][$key])); + $position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intval($extrafields->attributes[$object->table_element]['pos'][$key])); $arrayofgroupby[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-year'] = array( 'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val).' ('.$YYYY.')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index d6c721d8ccb..fb76fe69680 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -457,9 +457,9 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, } $im = imagecreate($total_x, $total_y); /* create two images */ - $col_bg = ImageColorAllocate($im, $bg_color[0], $bg_color[1], $bg_color[2]); - $col_bar = ImageColorAllocate($im, $bar_color[0], $bar_color[1], $bar_color[2]); - $col_text = ImageColorAllocate($im, $text_color[0], $text_color[1], $text_color[2]); + $col_bg = imagecolorallocate($im, $bg_color[0], $bg_color[1], $bg_color[2]); + $col_bar = imagecolorallocate($im, $bar_color[0], $bar_color[1], $bar_color[2]); + $col_text = imagecolorallocate($im, $text_color[0], $text_color[1], $text_color[2]); $height = round($total_y - ($scale * 10)); $height2 = round($total_y - $space['bottom']); diff --git a/htdocs/core/lib/images.lib.php b/htdocs/core/lib/images.lib.php index dfafcdf8537..126c613a15a 100644 --- a/htdocs/core/lib/images.lib.php +++ b/htdocs/core/lib/images.lib.php @@ -451,7 +451,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95) if ($infoImg[2] === IMAGETYPE_PNG) { // In fact there is no exif on PNG but just in case imagealphablending($img, false); imagesavealpha($img, true); - $img = imagerotate($img, $deg, imageColorAllocateAlpha($img, 0, 0, 0, 127)); + $img = imagerotate($img, $deg, imagecolorallocatealpha($img, 0, 0, 0, 127)); imagealphablending($img, false); imagesavealpha($img, true); } else { @@ -663,7 +663,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small', if ($infoImg[2] === 'IMAGETYPE_PNG') { // In fact there is no exif on PNG but just in case imagealphablending($img, false); imagesavealpha($img, true); - $rotated = imagerotate($img, $exifAngle, imageColorAllocateAlpha($img, 0, 0, 0, 127)); + $rotated = imagerotate($img, $exifAngle, imagecolorallocatealpha($img, 0, 0, 0, 127)); imagealphablending($rotated, false); imagesavealpha($rotated, true); } else { diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 9dc1c18f696..1f4669c7802 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -176,7 +176,7 @@ class mailing_pomme extends MailingTargets if (GETPOSTISSET("filter") && GETPOST("filter") == '0') { $sql .= " AND u.statut=0"; } - if (GETPOSTISSET("filteremployee") && GETPOSt("filteremployee") == '1') { + if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '1') { $sql .= " AND u.employee=1"; } if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '0') { diff --git a/htdocs/core/modules/mailings/xinputfile.modules.php b/htdocs/core/modules/mailings/xinputfile.modules.php index e1eed1ffb6d..55c5ce0bc54 100644 --- a/htdocs/core/modules/mailings/xinputfile.modules.php +++ b/htdocs/core/modules/mailings/xinputfile.modules.php @@ -164,7 +164,7 @@ class mailing_xinputfile extends MailingTargets if (!empty($buffer)) { //print 'xx'.dol_strlen($buffer).empty($buffer)."
\n"; - if (isValidEMail($email)) { + if (isValidEmail($email)) { if ($old != $email) { $cibles[$j] = array( 'email' => $email, diff --git a/htdocs/core/modules/mailings/xinputuser.modules.php b/htdocs/core/modules/mailings/xinputuser.modules.php index a141cb7881e..1f1a7cb5aa8 100644 --- a/htdocs/core/modules/mailings/xinputuser.modules.php +++ b/htdocs/core/modules/mailings/xinputuser.modules.php @@ -135,7 +135,7 @@ class mailing_xinputuser extends MailingTargets $cibles = array(); if (!empty($email)) { - if (isValidEMail($email)) { + if (isValidEmail($email)) { $cibles[] = array( 'email' => $email, 'lastname' => $lastname, diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php index 990f0b5f91d..30dd8e920a8 100644 --- a/htdocs/cron/card.php +++ b/htdocs/cron/card.php @@ -89,7 +89,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontodelete) { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } else { - Header("Location: ".DOL_URL_ROOT.'/cron/list.php'); + header("Location: ".DOL_URL_ROOT.'/cron/list.php'); exit; } } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 006631614af..cc146bbac9c 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1722,7 +1722,7 @@ class EmailCollector extends CommonObject if (preg_match('/^(Re|AW)\s*:\s+/i', $headers['Subject'])) { $isanswer = 1; } - if (getDolglobalString('EMAILCOLLECTOR_USE_IN_REPLY_TO_TO_DETECT_ANSWERS')) { + if (getDolGlobalString('EMAILCOLLECTOR_USE_IN_REPLY_TO_TO_DETECT_ANSWERS')) { // Note: "In-Reply-To" to detect if mail is an answer of another mail is not reliable because we can have: // Message-ID=A, In-Reply-To=B, References=B and message can BE an answer but may be NOT (for example a transfer of an email rewriten) if (!empty($headers['In-Reply-To'])) { diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 382c50301b2..47d7271f13c 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -249,7 +249,7 @@ class ConferenceOrBoothAttendee extends CommonObject { global $langs; - if (!isValidEMail($this->email)) { + if (!isValidEmail($this->email)) { $langs->load("errors"); $this->errors[] = $langs->trans("ErrorBadEMail", $this->email); return -1; diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index dbef6e011df..5d51a060d95 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -315,7 +315,7 @@ if (empty($reshook)) { if (!$error) { $db->commit(); - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 39ab18a6918..735d2c34bf7 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1813,7 +1813,7 @@ class FactureFournisseur extends CommonInvoice } else { if ($key == 'EMAIL') { // Check for mandatory - if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEMail($this->thirdparty->email)) { + if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEmail($this->thirdparty->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 7ac443caf33..11679a030fb 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -147,7 +147,7 @@ $permissiontoread = $user->hasRight('holiday', 'read'); $permissiontodelete = $user->hasRight('holiday', 'delete'); $permissiontoapprove = $user->hasRight('holiday', 'approve'); -if (!ismodEnabled('holiday')) { +if (!isModEnabled('holiday')) { accessforbidden('Module holiday not enabled'); } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index c68bd50c27b..5954090cb1e 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -292,7 +292,7 @@ if ($step == 3 && $datatoimport) { } else { setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } - Header('Location: '.$_SERVER["PHP_SELF"].'?step='.$step.$param); + header('Location: '.$_SERVER["PHP_SELF"].'?step='.$step.$param); exit; } } diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index ca47a61e3e2..02513e697be 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -75,7 +75,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) { if (preg_match('/del_(.*)/', $action, $reg)) { $code = $reg[1]; if (dolibarr_del_const($db, $code, 0) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index 64a5b83a6c9..96f32024b5d 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -5036,7 +5036,7 @@ if ($module == 'initmodule') { $dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath']; $destdir = $dirins.'/'.strtolower($module); $listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$'); - $objects = dolGetListOfObjectclasses($destdir); + $objects = dolGetListOfObjectClasses($destdir); $leftmenus = array(); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 00171df99c0..e3ba4563db4 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5199,7 +5199,7 @@ class Product extends CommonObject $datas['label']= '
'.$langs->trans('ProductLabel').': '.$this->label; } if (!empty($this->description)) { - $datas['description']= '
'.$langs->trans('ProductDescription').': '.dolGetFirstLineofText($this->description, 5); + $datas['description']= '
'.$langs->trans('ProductDescription').': '.dolGetFirstLineOfText($this->description, 5); } if ($this->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { if (isModEnabled('productbatch')) { diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index fb2081cb563..aba181da8f9 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -807,7 +807,7 @@ if ($id > 0 || $ref) { print ''.$langs->trans('GencodBuyPrice').''; print ''; print img_picto('', 'barcode', 'class="pictofixedwidth"'); - print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1); + print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1); print ' '; print ''; } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 45106ce0b32..cd8137b4609 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1678,7 +1678,7 @@ while ($i < $imaxinloop) { print ''; // Since description can be very large (several pages of HTML- // code) we limit to the first two rows - print dolGetFirstLineofText($product_static->description, 2); + print dolGetFirstLineOfText($product_static->description, 2); print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/product/stock/massstockmove.php b/htdocs/product/stock/massstockmove.php index 22db69246e5..48fdd6d27d8 100644 --- a/htdocs/product/stock/massstockmove.php +++ b/htdocs/product/stock/massstockmove.php @@ -526,7 +526,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') { } else { setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } - Header('Location: '.$_SERVER["PHP_SELF"]); + header('Location: '.$_SERVER["PHP_SELF"]); exit; } diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 1627bee2144..5a745e58d5d 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -144,7 +144,7 @@ if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && $object->element == 'product' } // Serial / Eat-by date -if (ismodEnabled('productbatch') && +if (isModEnabled('productbatch') && (($object->element == 'product' && $object->hasbatch()) || ($object->element == 'stock')) ) { diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index 5cf30de3bd9..28b81207da4 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -258,7 +258,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { $db->commit(); - Header("Location: " . $urlback); + header("Location: " . $urlback); exit; } else { $db->rollback(); diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 7626ecb9e16..4d246fa76a8 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -344,7 +344,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $db->commit(); - Header("Location: ".$redirection); + header("Location: ".$redirection); exit; } @@ -609,7 +609,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen } } - Header("Location: ".$redirection); + header("Location: ".$redirection); exit; } else { $db->rollback(); @@ -667,7 +667,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); - Header("Location: ".$redirection); + header("Location: ".$redirection); exit; } //Header("Location: ".$urlback); diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 7c0b127ed0c..14a45eb421c 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -474,7 +474,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { $db->commit(); - Header("Location: ".$urlback); + header("Location: ".$urlback); exit; } else { $db->rollback(); diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index c8cc832b183..5fb9e2b194b 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -512,7 +512,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { $db->commit(); - Header("Location: ".$urlback); + header("Location: ".$urlback); exit; } else { $db->rollback(); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 759e348fa47..0621eac22a2 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -383,7 +383,7 @@ if ($action == 'dopayment') { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")); $action = ''; // } elseif (empty($EMAIL)) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail")); - // } elseif (! isValidEMail($EMAIL)) { $mesg=$langs->trans("ErrorBadEMail",$EMAIL); + // } elseif (! isValidEmail($EMAIL)) { $mesg=$langs->trans("ErrorBadEMail",$EMAIL); } elseif (!$origfulltag) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentCode")); $action = ''; @@ -446,7 +446,7 @@ if ($action == 'dopayment') { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")); } elseif (empty($email)) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ONLINE_PAYMENT_SENDEMAIL")); - } elseif (!isValidEMail($email)) { + } elseif (!isValidEmail($email)) { $mesg = $langs->trans("ErrorBadEMail", $email); } elseif (!$origfulltag) { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentCode")); diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index 1a7dbbc644d..b3f553ba5b1 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -419,7 +419,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { $db->commit(); - Header("Location: ".$urlback); + header("Location: ".$urlback); exit; } else { $db->rollback(); diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index bac61fbda67..f4b8adb8d00 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add') { $redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN; } } - Header("Location: ".$redirection); + header("Location: ".$redirection); exit; }*/ } @@ -533,7 +533,7 @@ if (empty($reshook) && $action == 'add') { $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl; - Header("Location: ".$redirection); + header("Location: ".$redirection); exit; } else { $db->rollback(); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index da8de48cde6..39fcb7cc801 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add') { $db->commit(); $securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2); $redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl); - Header("Location: ".$redirection); + header("Location: ".$redirection); exit; } else { $db->rollback(); diff --git a/htdocs/recruitment/recruitmentcandidature_card.php b/htdocs/recruitment/recruitmentcandidature_card.php index a6ee9fd58ef..f812dd447d3 100644 --- a/htdocs/recruitment/recruitmentcandidature_card.php +++ b/htdocs/recruitment/recruitmentcandidature_card.php @@ -348,7 +348,7 @@ if (($id || $ref) && $action == 'edit') { if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $res = $object->fetch_optionals(); - $head = recruitmentcandidaturePrepareHead($object); + $head = recruitmentCandidaturePrepareHead($object); print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto); $formconfirm = ''; diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php index cba1ab1d2c0..3783f0de394 100644 --- a/htdocs/resource/card.php +++ b/htdocs/resource/card.php @@ -112,7 +112,7 @@ if (empty($reshook)) { if ($result > 0) { // Creation OK setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs'); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { // Creation KO @@ -121,7 +121,7 @@ if (empty($reshook)) { } } } else { - Header("Location: list.php"); + header("Location: list.php"); exit; } } @@ -150,7 +150,7 @@ if (empty($reshook)) { $result = $object->update($user); if ($result > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 03f0b5d141f..9f191c19c9f 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -430,7 +430,7 @@ if (empty($reshook)) { // Check parameters if (!GETPOST('cancel', 'alpha')) { - if (!empty($object->email) && !isValidEMail($object->email)) { + if (!empty($object->email) && !isValidEmail($object->email)) { $langs->load("errors"); $error++; setEventMessages($langs->trans("ErrorBadEMail", $object->email), null, 'errors'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 6cbbda427a3..0e569927ee1 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1239,7 +1239,7 @@ class Societe extends CommonObject //var_dump($conf->global->SOCIETE_EMAIL_MANDATORY); if ($key == 'EMAIL') { // Check for mandatory - if (getDolGlobalString('SOCIETE_EMAIL_MANDATORY') && !isValidEMail($this->email)) { + if (getDolGlobalString('SOCIETE_EMAIL_MANDATORY') && !isValidEmail($this->email)) { $langs->load("errors"); $error++; $this->errors[] = $langs->trans("ErrorBadEMail", $this->email).' ('.$langs->trans("ForbiddenBySetupRules").')'; diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 4b353843e0c..6c1b3cba18a 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -519,7 +519,7 @@ if (empty($reshook)) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { if ($object->delete($user) > 0) { setEventMessages('
'.$langs->trans('TicketDeletedSuccess').'
', null, 'mesgs'); - Header("Location: ".DOL_URL_ROOT."/ticket/list.php"); + header("Location: ".DOL_URL_ROOT."/ticket/list.php"); exit; } else { $langs->load("errors"); diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php index 08529aa0c04..b79c2501b85 100644 --- a/htdocs/ticket/contact.php +++ b/htdocs/ticket/contact.php @@ -157,7 +157,7 @@ if ($action == 'deletecontact' && $user->hasRight('ticket', 'write')) { $result = $object->delete_contact($lineid); if ($result >= 0) { - Header("Location: ".$url_page_current."?id=".$object->id); + header("Location: ".$url_page_current."?id=".$object->id); exit; } } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index c6d4003cf63..db0cd3a31fb 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1590,7 +1590,7 @@ class User extends CommonObject $badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\''); // Check parameters - if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEMail($this->email)) { + if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEmail($this->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->email); return -1; @@ -1993,7 +1993,7 @@ class User extends CommonObject // Check parameters $badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\''); - if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEMail($this->email)) { + if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEmail($this->email)) { $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail", $this->email); return -1; diff --git a/phpstan_action.neon b/phpstan_action.neon index aa63c928bab..c54f2cf4b89 100644 --- a/phpstan_action.neon +++ b/phpstan_action.neon @@ -30,7 +30,7 @@ parameters: checkAlwaysTrueStrictComparison: false checkClassCaseSensitivity: false checkFunctionArgumentTypes: false - checkFunctionNameCase: false + checkFunctionNameCase: true checkArgumentsPassedByReference: false checkMaybeUndefinedVariables: false checkNullables: false