noalyss-commit
[Top][All Lists]
Advanced

[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="/&lt;&lt;\\$[A-Z]*[0-9]*&gt;&gt;/";
         $lt="&lt;";
         $gt="&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"));
    }
     /**



reply via email to

[Prev in Thread] Current Thread [Next in Thread]