[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 04/20: PHP8.2 deprecated
From: |
dwm |
Subject: |
[Noalyss-commit] [noalyss] 04/20: PHP8.2 deprecated |
Date: |
Sun, 10 Dec 2023 03:22:23 -0500 (EST) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 86852bc4252e5dde7a04277393086355b12a6cc6
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Nov 12 22:22:27 2023 +0100
PHP8.2 deprecated
---
include/class/acc_bilan.class.php | 5 ++++-
include/class/dossier.class.php | 2 +-
include/header_print.php | 5 ++++-
include/lib/ac_common.php | 7 +++++--
include/lib/noalyss_csv.class.php | 2 +-
5 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/include/class/acc_bilan.class.php
b/include/class/acc_bilan.class.php
index 9b30ed5e1..3f398e09c 100644
--- a/include/class/acc_bilan.class.php
+++ b/include/class/acc_bilan.class.php
@@ -398,7 +398,10 @@ class Acc_Bilan
$regex="/<<\\$[A-Z]*[0-9]*>>/";
$lt="<";
$gt=">";
- $header_txt=utf8_encode(header_txt($this->db));
+ // convert to UTF8
+ $header_txt=iconv('ISO-8859-1','UTF-8//IGNORE',header_txt($this->db));
+
+
while ( !feof($p_file) )
{
diff --git a/include/class/dossier.class.php b/include/class/dossier.class.php
index e4aafdcf1..46c53e615 100644
--- a/include/class/dossier.class.php
+++ b/include/class/dossier.class.php
@@ -171,7 +171,7 @@ class Dossier
try {
$http=new HttpInput();
$id=$http->request("gDossier","number");
- if ($id > 999999 || $id < 0) throw new \Exception(_("Dossier max
dépassé"));
+ if ($id > 999999 || $id < 0) throw new \Exception(_("Dossier max
dépassé "));
} catch (\Exception $e) {
die('Dossier invalide ');
diff --git a/include/header_print.php b/include/header_print.php
index 7a510a068..8f4aaacf5 100644
--- a/include/header_print.php
+++ b/include/header_print.php
@@ -34,7 +34,10 @@ function header_txt($p_cn)
$soc=$own->MY_NAME;
$date=date('d / m / Y H:i ');
- $dossier=utf8_decode(" Dossier : ".dossier::name());
+ $str=sprintf(" Dossier : %s",dossier::name());
+ // convert to latin1
+ $dossier=iconv('UTF-8','ISO-8859-1//IGNORE',$str);
+
return $dossier." ".$soc." ".$date;
}
diff --git a/include/lib/ac_common.php b/include/lib/ac_common.php
index cf3d0300e..dcab67a9f 100644
--- a/include/lib/ac_common.php
+++ b/include/lib/ac_common.php
@@ -1374,14 +1374,17 @@ if(!function_exists('tracedebug')) {
}
}
/**
- * @brief encode the string for RTF, return a stringu
+ * @brief encode the string for RTF, return a string
* @param $p_string string to convert
* @return string
*/
function convert_to_rtf($p_string)
{
$result="";
- $p_string2=utf8_decode($p_string);
+ // convert to latin
+ $p_string2=iconv('UTF-8','ISO-8859-1//IGNORE',$p_string);
+
+
$nb_result=strlen($p_string2);
for ($i = 0 ; $i < $nb_result ; $i++ ){
if (ord($p_string[$i]) < 127 ) {
diff --git a/include/lib/noalyss_csv.class.php
b/include/lib/noalyss_csv.class.php
index 47a2acdb8..dbd389afd 100644
--- a/include/lib/noalyss_csv.class.php
+++ b/include/lib/noalyss_csv.class.php
@@ -181,7 +181,7 @@ class Noalyss_Csv
protected function encode($str)
{
if ($this->encoding=="utf8") return $str;
- if ($this->encoding=="latin1") return utf8_decode ($str);
+ if ($this->encoding=="latin1") return
iconv('UTF-8','ISO-8859-1//IGNORE',$str);
throw new Exception(_("Encodage invalide"));
}
/**
- [Noalyss-commit] [noalyss] 08/20: Improve documentation, (continued)
- [Noalyss-commit] [noalyss] 08/20: Improve documentation, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 01/20: PHP Compatibility 8.1, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 17/20: PRINTGL Main Ledger (GL), dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 20/20: Fix merge issue, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 06/20: ergo, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 15/20: Improve DatabaseCore : fetch_all, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 10/20: Merge master, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 07/20: Update link to https://www.noalyss.eu instead of http, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 03/20: Documentation, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 09/20: Protect Qcode in fiche_detail, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 04/20: PHP8.2 deprecated,
dwm <=
- [Noalyss-commit] [noalyss] 14/20: Improve DBG , add stopwatch : timer_start and timer_show, dwm, 2023/12/10
- [Noalyss-commit] [noalyss] 12/20: Improve Unit Test for Report, dwm, 2023/12/10