phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4207 - in phpcompta/trunk: html include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4207 - in phpcompta/trunk: html include
Date: Wed, 28 Sep 2011 16:19:20 +0200 (CEST)

Author: danydb
Date: 2011-09-28 16:19:20 +0200 (Wed, 28 Sep 2011)
New Revision: 4207

Modified:
   phpcompta/trunk/html/get_pj.php
   phpcompta/trunk/include/ac_common.php
   phpcompta/trunk/include/class_acc_bilan.php
   phpcompta/trunk/include/impress_inc.php
Log:
Code cleaniing : remove myereg and ereg function 

Modified: phpcompta/trunk/html/get_pj.php
===================================================================
--- phpcompta/trunk/html/get_pj.php     2011-09-28 14:11:14 UTC (rev 4206)
+++ phpcompta/trunk/html/get_pj.php     2011-09-28 14:19:20 UTC (rev 4207)
@@ -46,7 +46,7 @@
     }
 
 }
-if ( myereg('^[0-9]+$',$l) == false )
+if ( is_integer($l) == false  )
 {
     exit();
 }

Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php       2011-09-28 14:11:14 UTC (rev 
4206)
+++ phpcompta/trunk/include/ac_common.php       2011-09-28 14:19:20 UTC (rev 
4207)
@@ -644,38 +644,8 @@
     $str_date=$date[2].'.'.$date[1].'.'.$date[0];
     return $str_date;
 }
+
 /**
- address@hidden ereg is not supported from the version 5.3 and is marked as
- *obsolete, this function will call preg_match and returns
- * false is nothing is found or the length of the string found
- address@hidden  
- address@hidden
- address@hidden
- address@hidden
- */
-function myereg($p_pattern,$p_string,&$p_array=null)
-{
-    $version=phpversion();
-    if ( substr($version,0,3) == '5.2' )
-    {
-        /* mimic old ereg */
-        return ereg($p_pattern,$p_string,$p_array);
-    }
-    else
-    {
-        /* use the new preg_match */
-        /**
-         address@hidden ereg are obsolete from the version 5.3.0
-         * we have to emulate it 
-         */
-        /*      $a=preg_match_all($p_pattern,$p_string,$p_array);
-        if ( $a == 0 ) return false;
-        return true;*/
-        address@hidden($p_pattern,$p_string,$p_array);
-        return $a;
-    }
-}
-/**
  address@hidden remove the quote or double quote them
  address@hidden $q string
  address@hidden string correctly quoted

Modified: phpcompta/trunk/include/class_acc_bilan.php
===================================================================
--- phpcompta/trunk/include/class_acc_bilan.php 2011-09-28 14:11:14 UTC (rev 
4206)
+++ phpcompta/trunk/include/class_acc_bilan.php 2011-09-28 14:19:20 UTC (rev 
4207)
@@ -315,9 +315,6 @@
                 continue;
             // buffer contains a formula A$=....
             // We need to eval it
-            //myereg("\\$[a-zA-Z]+[0-9]*=",$buffer,$e);
-            //  echo $e[0];
-            //echo "<br>".$form;
             
$a=ParseFormula($this->db,"$buffer",$buffer,$this->from,$this->to,false);
             $b=str_replace("$","\$this->",$a);
             if ( eval("$b;") === false )

Modified: phpcompta/trunk/include/impress_inc.php
===================================================================
--- phpcompta/trunk/include/impress_inc.php     2011-09-28 14:11:14 UTC (rev 
4206)
+++ phpcompta/trunk/include/impress_inc.php     2011-09-28 14:19:20 UTC (rev 
4207)
@@ -193,7 +193,7 @@
  */
 function CheckFormula($p_string)
 {
-    // the myereg gets too complex if we want to add a test
+    // the preg_match gets too complex if we want to add a test
     // for parenthesis, math function...
     // So I prefer remove them before testing
     $p_string=str_replace("round","",$p_string);




reply via email to

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