diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index ed592c8ff9169..1663a64d1bf97 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -1,6 +1,7 @@ * Copyright (C) 2019-2024 Frédéric France + * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,7 +136,7 @@ $formfile = new FormFile($db); $title = $langs->trans('BOM'); -$help_url ='EN:Module_BOM'; +$help_url = 'EN:Module_BOM'; llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-bom page-net_needs'); @@ -330,7 +331,7 @@ if ($useunit) { require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $unit = new CUnits($db); - $unit->fetch($elem['fk_unit']); + $unit->fetch((int) $elem['fk_unit']); print(isset($unit->label) ? " ".$langs->trans(ucwords($unit->label))." " : ''); } print ''; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index bc0cd86198c6d..d22f304ca0d92 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -1984,7 +1984,7 @@ public function buildSwitzerlandQRString() $s .= dol_trunc($mysoc->country_code, 2, 'right', 'UTF-8', 1)."\n";*/ } else { $s .= "S\n"; - $s .= dol_trunc($mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc((string) $mysoc->name, 70, 'right', 'UTF-8', 1)."\n"; $addresslinearray = explode("\n", $mysoc->address); $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 @@ -2005,7 +2005,7 @@ public function buildSwitzerlandQRString() $s .= ($this->multicurrency_code ? $this->multicurrency_code : $conf->currency)."\n"; // Buyer $s .= "S\n"; - $s .= dol_trunc($this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; + $s .= dol_trunc((string) $this->thirdparty->name, 70, 'right', 'UTF-8', 1)."\n"; $addresslinearray = explode("\n", $this->thirdparty->address); $s .= dol_trunc(empty($addresslinearray[1]) ? '' : $addresslinearray[1], 70, 'right', 'UTF-8', 1)."\n"; // address line 1 $s .= dol_trunc(empty($addresslinearray[2]) ? '' : $addresslinearray[2], 70, 'right', 'UTF-8', 1)."\n"; // address line 2 diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 8c456044410f3..28561f73648b4 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Yann Droneaud * Copyright (C) 2012 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -53,11 +53,11 @@ class DoliDBPgsql extends DoliDB const VERSIONMIN = '9.0.0'; // Version min database /** - * @var boolean $unescapeslashquot Set this to 1 when calling SQL queries, to say that SQL is not standard but already escaped for Mysql. Used by PostgreSQL driver + * @var boolean Set this to 1 when calling SQL queries, to say that SQL is not standard but already escaped for Mysql. Used by PostgreSQL driver */ public $unescapeslashquot = false; /** - * @var boolean $standard_conforming_strings Set this to true if postgres accept only standard encoding of string using '' and not \' + * @var boolean Set this to true if postgres accept only standard encoding of string using '' and not \' */ public $standard_conforming_strings = false; @@ -951,7 +951,7 @@ public function DDLCreateDb($database, $charset = '', $collation = '', $owner = //print $charset.' '.setlocale(LC_CTYPE,'0'); exit; // NOTE: Do not use ' around the database name - $sql = "CREATE DATABASE ".$this->escape($database)." OWNER '".$this->escape($owner)."' ENCODING '".$this->escape($charset)."'"; + $sql = "CREATE DATABASE ".$this->escape($database)." OWNER '".$this->escape($owner)."' ENCODING '".$this->escape((string) $charset)."'"; dol_syslog($sql, LOG_DEBUG); $ret = $this->query($sql); diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 72d260e152502..8f6f88a21ce89 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Charles-Fr BENKE * Copyright (C) 2015 Juanjo Menent * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -631,7 +631,7 @@ $entityicon = $tmparray[0]; $entitylang = $tmparray[1]; } - print img_object('', $entityicon).' '.$langs->trans($entitylang); + print img_object('', $entityicon).' '.$langs->trans((string) $entitylang); print ''; $text = (empty($objexport->array_export_special[0][$code]) ? '' : ''); @@ -641,7 +641,7 @@ } else { $text .= $langs->trans($label); } - $text .=(empty($objexport->array_export_special[0][$code]) ? '' : ''); + $text .= (empty($objexport->array_export_special[0][$code]) ? '' : ''); $tablename = getablenamefromfield($code, $sqlmaxforexport); $htmltext = ''.$langs->trans("Name").": ".$text.'
'; @@ -823,7 +823,7 @@ $entityicon = $tmparray[0]; $entitylang = $tmparray[1]; } - print img_object('', $entityicon).' '.$langs->trans($entitylang); + print img_object('', $entityicon).' '.$langs->trans((string) $entitylang); print ''; // Field name @@ -837,7 +837,7 @@ } else { $text .= $langs->trans($label); } - $text .=(empty($objexport->array_export_special[0][$code]) ? '' : ''); + $text .= (empty($objexport->array_export_special[0][$code]) ? '' : ''); $tablename = getablenamefromfield($code, $sqlmaxforexport); $htmltext = ''.$langs->trans("Name").': '.$text.'
'; @@ -1034,7 +1034,7 @@ $entityicon = $tmparray[0]; $entitylang = $tmparray[1]; } - print img_object('', $entityicon).' '.$langs->trans($entitylang); + print img_object('', $entityicon).' '.$langs->trans((string) $entitylang); print ''; $labelName = $objexport->array_export_fields[0][$code]; @@ -1046,7 +1046,7 @@ } else { $text .= $langs->trans($labelName); } - $text .=(empty($objexport->array_export_special[0][$code]) ? '' : ''); + $text .= (empty($objexport->array_export_special[0][$code]) ? '' : ''); $tablename = getablenamefromfield($code, $sqlmaxforexport); $htmltext = ''.$langs->trans("Name").': '.$text.'
'; diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index d1efc20b1ea0c..ae56eae9af46b 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -1173,7 +1173,7 @@ public function exportWebSite() $line .= "'".$this->db->escape($objectpageold->status)."', "; $line .= "'".$this->db->idate($objectpageold->date_creation)."', "; $line .= "'".$this->db->idate($objectpageold->date_modification)."', "; - $line .= ($objectpageold->import_key ? "'".$this->db->escape($objectpageold->import_key)."'" : "null").", "; + $line .= ($objectpageold->import_key ? "'".$this->db->escape((string) $objectpageold->import_key)."'" : "null").", "; $line .= "'".$this->db->escape($objectpageold->grabbed_from)."', "; $line .= "'".$this->db->escape($objectpageold->type_container)."', "; diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index 59c5afa6c8d8a..b2ce563d33aa4 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Nicolas ZABOURI * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -163,7 +163,7 @@ class WebsitePage extends CommonObject public $fk_object; /** - * @var int Another ID that is the $id but with an offset so that ID of pages of the website start at 1 + * @var int Another ID that is the but with an offset so that ID of pages of the website start at 1 */ public $newid; @@ -661,7 +661,7 @@ public function update(User $user, $notrigger = 0) return -1; } $tmppage = new WebsitePage($this->db); - $tmppage->fetch($this->fk_page); + $tmppage->fetch((int) $this->fk_page); if ($tmppage->lang == $this->lang) { $this->error = "ErrorLanguageOfTranslatedPageIsSameThanThisPage"; return -1;