noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 189/219: Task #1506 Fiche : max longueur du p


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 189/219: Task #1506 Fiche : max longueur du poste comptable = 40
Date: Mon, 18 Dec 2017 13:23:01 -0500 (EST)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 44e3379ac48533857bd54ff5df8d1dda30a7b353
Author: Dany De Bontridder <address@hidden>
Date:   Sat Dec 9 12:56:52 2017 +0100

    Task #1506 Fiche : max longueur du poste comptable = 40
---
 include/class/fiche.class.php | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 21fead6..8920988 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -804,7 +804,9 @@ class Fiche
                 // account
                 if ($id==ATTR_DEF_ACCOUNT)
                 {
-                    $v=mb_substr(sql_string($value), 0, 40);
+                    if ( mb_strlen($value)>40) throw new Exception (_("Poste 
comptable trop long"), 1);
+                    $v=sql_string($value);
+                    
                     try
                     {
                         // Check that the accounting can be used directly
@@ -813,7 +815,7 @@ class Fiche
                             if (strpos($value, ',')==0)
                             {
                                 $v=$this->cn->get_value("select 
format_account($1)",
-                                        array($value));
+                                        array($v));
                                 
                                 // Check that the accounting can be used 
directly
                                 $acc_account=new Acc_Account($this->cn,$v);



reply via email to

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