Giter VIP home page Giter VIP logo

agilebill's People

Contributors

box25 avatar mediart avatar tpenguin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agilebill's Issues

Install step3 MySQL errors

MySQL tables are created, but many errors in the installation step 3:

5 Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TYPE=MyISAM' at line 11
...
ALTER TABLE ab_module ADD INDEX parent (parent_id) Error (install_sql-3): Table 'agile_bill.ab_module' doesn't exist

Unable to read tickets

Somebody submit a ticket through your ticket system,
but I hit list to view the tickets, though it is not showed.
It also does not send out an email either. This is CRITICAL!

Database creation errors

I did a git clone and ran the install script. I selected a bunch of plugins and I saw these errors:

ALTER TABLE ab_faq_translate ADD INDEX fulltext_faq (answer, question)
Error (install_sql-3): BLOB/TEXT column 'answer' used in key specification without a key length
ALTER TABLE ab_ticket ADD INDEX fulltext_content (subject, body)
Error (install_sql-3): BLOB/TEXT column 'body' used in key specification without a key length
ALTER TABLE ab_ticket_message ADD INDEX fulltext_message (message)
Error (install_sql-3): BLOB/TEXT column 'message' used in key specification without a key length
ALTER TABLE ab_ticket_attachment ADD INDEX fulltext_content (content)
Error (install_sql-3): BLOB/TEXT column 'content' used in key specification without a key length

invoice service date ranges incorrect

I get an incorrect service date range when I invoice a product or service when the billing schedule is quarterly , semi-annual , annual etc...the service date range is always a month from the date of invoice and not accurate to the billing schedule of the product .yet it should be 3 months , 6 months etc.. from the date of invoice.Can this be fixed?

Cryptographically insecure RSA implementation

Given that a reasonable amount of people Watch and Star this older project, reporting this.

This file contains a small list of small primes, that is easily crackable and thus insecure:

$this->primes = array (4507, 4513, 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597,

Issue is similar as: https://twitter.com/voodooKobra/status/663581509069242368

The small primes are picked and used to generate a small insecure key at lines 47 and 49.

customize invoice template

It seems there are two invoice templates invoice1.pdf and invoice2.pdf , how can I change between the two ? unfortunately the documentation has minimal information , I would appreciate any info on this.

Is it possible to customize the templates and how?

Regards,
Zanele

discount code issues

I cannot get the discount code to work. I have only 1 payment option which is paypal it just bypasses the coupon entry box and tries ton take me straght to Paypal.
If i cancel and then enter the code in the box it says invalid code or date.
Now the code is correct and i tried entering a start date and end date but still nothing.
The packages i am selling are recurring but i need to give new customers a one off discount if they enter the code at checkout.
Help please as i'm loving Agilebill and don't want to change.

Install problems

After install on CentOS 5.2 incl. all required stuff, just cannot make the install finish correctly. After generating the config file correctly it simply does not load pages (blanc)
Tried all "older stuff like uploading in Binary, reconfigure the config, changing the base-path in several alternatives etc.

Please suggest/solve?

Bert

php 5.3 support

ereg, eregi, ereg_replace are all deprecated in php 5.3. here's a patch that fixes the most visible errors. ( many other remain unfixed, but you can see the pattern used ).

diff --git a/htaccess_index.php b/htaccess_index.php
index dee70ba..556199e 100644
--- a/htaccess_index.php
+++ b/htaccess_index.php
@@ -111,7 +111,7 @@
     if  (file_exists($DOCUMENT_ROOT.$REQUEST_URI) &&
         ($SCRIPT_FILENAME            != $DOCUMENT_ROOT.$REQUEST_URI) &&
         ($REQUEST_URI                != "/") &&
-        (!ereg( '[////]{2,}$', $REQUEST_URI ) ) )
+        (!preg_match( '/[////]{2,}$/', $REQUEST_URI ) ) )
         {
 
         $url = $REQUEST_URI;
@@ -263,4 +263,4 @@
         }
                
        ob_end_flush();
-?>
\ No newline at end of file
+?>
diff --git a/includes/adodb/drivers/adodb-postgres7.inc.php b/includes/adodb/drivers/adodb-postgres7.inc.php
index ef5ce88..e5c16ca 100644
--- a/includes/adodb/drivers/adodb-postgres7.inc.php
+++ b/includes/adodb/drivers/adodb-postgres7.inc.php
@@ -95,9 +95,9 @@ class ADODB_postgres7 extends ADODB_postgres64 {
          $a = array();
          while (!$rs->EOF) {
            if ($upper) {
-             $a[strtoupper($rs->Fields('lookup_table'))][] = strtoupper(ereg_replace('"','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field')));
+             $a[strtoupper($rs->Fields('lookup_table'))][] = strtoupper(preg_replace('/"/','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field')));
            } else {
-             $a[$rs->Fields('lookup_table')][] = ereg_replace('"','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field'));
+             $a[$rs->Fields('lookup_table')][] = preg_replace('/"/','',$rs->Fields('dep_field').'='.$rs->Fields('lookup_field'));
            }
            adodb_movenext($rs);
          }
@@ -310,4 +310,4 @@ class ADORecordSet_assoc_postgres7 extends ADORecordSet_postgres64{
                return false;
        }
 }
-?>
\ No newline at end of file
+?>
diff --git a/includes/adodb/drivers/adodb-sybase.inc.php b/includes/adodb/drivers/adodb-sybase.inc.php
index 9c00d02..cb3c23d 100644
--- a/includes/adodb/drivers/adodb-sybase.inc.php
+++ b/includes/adodb/drivers/adodb-sybase.inc.php
@@ -376,7 +376,7 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
        global $ADODB_sybase_mths;
        
                //Dec 30 2000 12:00AM
-               if (!ereg( "([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})"
+               if (!preg_match( "/([A-Za-z]{3})[-/\. ]+([0-9]{1,2})[-/\. ]+([0-9]{4})/"
                        ,$v, $rr)) return parent::UnixDate($v);
                        
                if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
@@ -393,7 +393,7 @@ class ADORecordSet_array_sybase extends ADORecordSet_array {
        global $ADODB_sybase_mths;
                //11.02.2001 Toni Tunkkari [email protected]
                //Changed [0-9] to [0-9 ] in day conversion
-               if (!ereg( "([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})"
+               if (!preg_match( "/([A-Za-z]{3})[-/\. ]([0-9 ]{1,2})[-/\. ]([0-9]{4}) +([0-9]{1,2}):([0-9]{1,2}) *([apAP]{0,1})/"
                        ,$v, $rr)) return parent::UnixTimeStamp($v);
                if ($rr[3] <= TIMESTAMP_FIRST_YEAR) return 0;
                
diff --git a/includes/nusoap/lib/class.nusoap_base.php b/includes/nusoap/lib/class.nusoap_base.php
index 87746b7..a73b3d4 100644
--- a/includes/nusoap/lib/class.nusoap_base.php
+++ b/includes/nusoap/lib/class.nusoap_base.php
@@ -562,7 +562,7 @@ class nusoap_base {
                        case (is_array($val) || $type):
                                // detect if struct or array
                                $valueType = $this->isArraySimpleOrStruct($val);
-                if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
+                if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
                                        $this->debug("serialize_val: serialize array");
                                        $i = 0;
                                        if(is_array($val) && count($val)> 0){
@@ -765,7 +765,7 @@ class nusoap_base {
        */
        function expandQname($qname){
                // get element prefix
-               if(strpos($qname,':') && !ereg('^http://',$qname)){
+               if(strpos($qname,':') && !preg_match('/^http:/',$qname)){
                        // get unqualified name
                        $name = substr(strstr($qname,':'),1);
                        // get ns prefix
@@ -914,7 +914,7 @@ function timestamp_to_iso8601($timestamp,$utc=true){
                '([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
                '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
 
-               if(ereg($eregStr,$datestr,$regs)){
+               if(preg_match('/'.$eregStr.'/',$datestr,$regs)){
                        return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
                }
                return false;
@@ -939,7 +939,7 @@ function iso8601_to_timestamp($datestr){
        '([0-9]{2}):'.  // minutes mm:
        '([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
        '(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
-       if(ereg($eregStr,$datestr,$regs)){
+       if(preg_match('/'.$eregStr.'/',$datestr,$regs)){
                // not utc
                if($regs[8] != 'Z'){
                        $op = substr($regs[8],0,1);
@@ -981,4 +981,4 @@ function usleepWindows($usec)
 }
 
 
-?>
\ No newline at end of file
+?>
diff --git a/includes/nusoap/lib/class.soap_parser.php b/includes/nusoap/lib/class.soap_parser.php
index d451dae..921c0d5 100644
--- a/includes/nusoap/lib/class.soap_parser.php
+++ b/includes/nusoap/lib/class.soap_parser.php
@@ -207,7 +207,7 @@ class nusoap_parser extends nusoap_base {
                        $key_localpart = $this->getLocalPart($key);
                        // if ns declarations, add to class level array of valid namespaces
             if($key_prefix == 'xmlns'){
-                               if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
+                               if(preg_match('/^http://www.w3.org/[0-9]{4}/XMLSchema$/',$value)){
                                        $this->XMLSchemaVersion = $value;
                                        $this->namespaces['xsd'] = $this->XMLSchemaVersion;
                                        $this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
@@ -244,7 +244,7 @@ class nusoap_parser extends nusoap_base {
                                [6]    nextDimension    ::=    Digit+ ','
                                */
                                $expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
-                               if(ereg($expr,$value,$regs)){
+                               if(preg_match('/'.$expr.'/',$value,$regs)){
                                        $this->message[$pos]['typePrefix'] = $regs[1];
                                        $this->message[$pos]['arrayTypePrefix'] = $regs[1];
                        if (isset($this->namespaces[$regs[1]])) {
@@ -636,4 +636,4 @@ class soap_parser extends nusoap_parser {
 }
 
 
-?>
\ No newline at end of file
+?>
diff --git a/includes/nusoap/lib/class.soap_server.php b/includes/nusoap/lib/class.soap_server.php
index a6f1cb4..abcb4e5 100644
--- a/includes/nusoap/lib/class.soap_server.php
+++ b/includes/nusoap/lib/class.soap_server.php
@@ -245,7 +245,7 @@ class nusoap_server extends nusoap_base {
                }
                $this->debug("In service, query string=$qs");
 
-               if (ereg('wsdl', $qs) ){
+               if (preg_match('/wsdl/', $qs) ){
                        $this->debug("In service, this is a request for WSDL");
                        if($this->externalWSDLURL){
               if (strpos($this->externalWSDLURL,"://")!==false) { // assume URL
@@ -316,7 +316,7 @@ class nusoap_server extends nusoap_base {
                        // get the character encoding of the incoming request
                        if(isset($this->headers['content-type']) && strpos($this->headers['content-type'],'=')){
                                $enc = str_replace('"','',substr(strstr($this->headers["content-type"],'='),1));
-                               if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+                               if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
                                        $this->xml_encoding = strtoupper($enc);
                                } else {
                                        $this->xml_encoding = 'US-ASCII';
@@ -345,7 +345,7 @@ class nusoap_server extends nusoap_base {
                                                $enc = substr(strstr($v, '='), 1);
                                                $enc = str_replace('"', '', $enc);
                                                $enc = str_replace('\\', '', $enc);
-                                               if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+                                               if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
                                                        $this->xml_encoding = strtoupper($enc);
                                                } else {
                                                        $this->xml_encoding = 'US-ASCII';
@@ -379,7 +379,7 @@ class nusoap_server extends nusoap_base {
                                                $enc = substr(strstr($v, '='), 1);
                                                $enc = str_replace('"', '', $enc);
                                                $enc = str_replace('\\', '', $enc);
-                                               if (eregi('^(ISO-8859-1|US-ASCII|UTF-8)$', $enc)) {
+                                               if (preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i', $enc)) {
                                                        $this->xml_encoding = strtoupper($enc);
                                                } else {
                                                        $this->xml_encoding = 'US-ASCII';
@@ -717,7 +717,7 @@ class nusoap_server extends nusoap_base {
                $payload .= $this->getDebugAsXMLComment();
         }
                $this->outgoing_headers[] = "Server: $this->title Server v$this->version";
-               ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+               preg_match('/\$Revisio/' . 'n: ([^ ]+)', $this->revision, $rev);
                $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")";
                // Let the Web server decide about this
                //$this->outgoing_headers[] = "Connection: Close\r\n";
@@ -805,7 +805,7 @@ class nusoap_server extends nusoap_base {
                if (strpos($headers['content-type'], '=')) {
                        $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
                        $this->debug('Got response encoding: ' . $enc);
-                       if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+                       if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
                                $this->xml_encoding = strtoupper($enc);
                        } else {
                                $this->xml_encoding = 'US-ASCII';
@@ -1070,4 +1070,4 @@ class soap_server extends nusoap_server {
 }
 
 
-?>
\ No newline at end of file
+?>
diff --git a/includes/nusoap/lib/class.soap_transport_http.php b/includes/nusoap/lib/class.soap_transport_http.php
index ecfab92..6cc4de9 100644
--- a/includes/nusoap/lib/class.soap_transport_http.php
+++ b/includes/nusoap/lib/class.soap_transport_http.php
@@ -66,7 +66,7 @@ class soap_transport_http extends nusoap_base {
                        $this->ch_options = $curl_options;
                }
                $this->use_curl = $use_curl;
-               ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
+               preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev);
                $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
        }
 
@@ -829,7 +829,7 @@ class soap_transport_http extends nusoap_base {
                                }
                        }
                        // remove 100 headers
-                       if (isset($lb) && ereg('^HTTP/1.1 100',$data)) {
+                       if (isset($lb) && preg_match('/^HTTP/1.1 100/',$data)) {
                                unset($lb);
                                $data = '';
                        }//
@@ -995,7 +995,7 @@ class soap_transport_http extends nusoap_base {
                if ($data == '') {
                        // have nothing left; just remove 100 header(s)
                        $data = $savedata;
-                       while (ereg('^HTTP/1.1 100',$data)) {
+                       while (preg_match('/^HTTP/1.1 100/',$data)) {
                                if ($pos = strpos($data,"\r\n\r\n")) {
                                        $data = ltrim(substr($data,$pos));
                                } elseif($pos = strpos($data,"\n\n") ) {
@@ -1302,4 +1302,4 @@ class soap_transport_http extends nusoap_base {
 }
 
 
-?>
\ No newline at end of file
+?>
diff --git a/includes/nusoap/lib/class.soapclient.php b/includes/nusoap/lib/class.soapclient.php
index 0916eea..303b7a6 100644
--- a/includes/nusoap/lib/class.soapclient.php
+++ b/includes/nusoap/lib/class.soapclient.php
@@ -406,7 +406,7 @@ class nusoap_client extends nusoap_base  {
                // detect transport
                switch(true){
                        // http(s)
-                       case ereg('^http',$this->endpoint):
+                       case preg_match('/^http/',$this->endpoint):
                                $this->debug('transporting via HTTP');
                                if($this->persistentConnection == true && is_object($this->persistentConnection)){
                                        $http =& $this->persistentConnection;
@@ -428,10 +428,10 @@ class nusoap_client extends nusoap_base  {
                                        $http->setEncoding($this->http_encoding);
                                }
                                $this->debug('sending message, length='.strlen($msg));
-                               if(ereg('^http:',$this->endpoint)){
+                               if(preg_match('/^http:/',$this->endpoint)){
                                //if(strpos($this->endpoint,'http:')){
                                        $this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
-                               } elseif(ereg('^https',$this->endpoint)){
+                               } elseif(preg_match('/^https/',$this->endpoint)){
                                //} elseif(strpos($this->endpoint,'https:')){
                                        //if(phpversion() == '4.3.0-dev'){
                                                //$response = $http->send($msg,$timeout,$response_timeout);
@@ -490,7 +490,7 @@ class nusoap_client extends nusoap_base  {
                if (strpos($headers['content-type'], '=')) {
                        $enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
                        $this->debug('Got response encoding: ' . $enc);
-                       if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
+                       if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
                                $this->xml_encoding = strtoupper($enc);
                        } else {
                                $this->xml_encoding = 'US-ASCII';
diff --git a/includes/nusoap/lib/class.wsdl.php b/includes/nusoap/lib/class.wsdl.php
index f435e54..1382bc0 100644
--- a/includes/nusoap/lib/class.wsdl.php
+++ b/includes/nusoap/lib/class.wsdl.php
@@ -1901,4 +1901,4 @@ class wsdl extends nusoap_base {
        } 
 }
 
-?>
\ No newline at end of file
+?>
diff --git a/includes/smarty/plugins/function.html_menu_files.php b/includes/smarty/plugins/function.html_menu_files.php
index eaf4ffc..d60aa09 100644
--- a/includes/smarty/plugins/function.html_menu_files.php
+++ b/includes/smarty/plugins/function.html_menu_files.php
@@ -38,13 +38,13 @@ function smarty_function_html_menu_files($params, &$smarty)
                {
                        if(!empty($ext))
                        {
-                               $cute = eregi_replace($ext.'$', "", $file_name);
-                               if(!eregi($ext.'$', $file_name)) $display = false;
+                               $cute = preg_replace('/'.$ext.'$/i', "", $file_name);
+                               if(!preg_match('/'.$ext.'$/i', $file_name)) $display = false;
                        }
                        if(!empty($pre))
                        {
-                               $cute = eregi_replace('^'.$pre, "", $cute);
-                               if(!eregi('^'.$pre, $file_name))  $display = false;
+                               $cute = preg_replace('/^'.$pre.'/i', "", $cute);
+                               if(!preg_match('/^'.$pre.'/i', $file_name))  $display = false;
                        }
                        if($display)
                        {
@@ -77,4 +77,4 @@ function smarty_function_html_menu_files($params, &$smarty)
        
        echo $return;
 } 
-?>
\ No newline at end of file
+?>
diff --git a/index.php b/index.php
index 966d293..996982b 100644
--- a/index.php
+++ b/index.php
@@ -1,4 +1,6 @@
 generate_form('account', 'add', 'search');
                else
                $arr = $static_var->generate_form('account', 'add', 'update');
@@ -1332,4 +1332,4 @@ class account
                }
        }
 }
-?>
\ No newline at end of file
+?>
diff --git a/modules/account_admin/account_admin.inc.php b/modules/account_admin/account_admin.inc.php
index 2548fea..183d0d9 100644
--- a/modules/account_admin/account_admin.inc.php
+++ b/modules/account_admin/account_admin.inc.php
@@ -1915,7 +1915,7 @@ class account_admin
                                if($value != '')
                                {
                                        $pat = "^" . $this->module . "_";
-                                       if(eregi($pat, $key))
+                                       if(preg_match('/'.$pat.'/', $key))
                                        {                                       
                                                $field = eregi_replace($pat,"",$key);
                                                if(eregi('%',$value))
@@ -2649,4 +2649,4 @@ class account_admin
                }                                                                
        }                               
 }
-?>
\ No newline at end of file
+?>
diff --git a/modules/charge/charge.inc.php b/modules/charge/charge.inc.php
index 3f25c27..4066d36 100644
--- a/modules/charge/charge.inc.php
+++ b/modules/charge/charge.inc.php
@@ -613,7 +613,7 @@ class charge
                                if($value != '')
                                {
                                        $pat = "^" . $this->module . "_";
-                                       if(eregi($pat, $key))
+                                       if(preg_match('/'.$pat.'/i', $key))
                                        {                                       
                                                $field = eregi_replace($pat,"",$key);
                                                if(eregi('%',$value))
@@ -1112,4 +1112,4 @@ class charge
                } 
        }        
 }
-?>
\ No newline at end of file
+?>
diff --git a/modules/invoice/invoice.inc.php b/modules/invoice/invoice.inc.php
index c326fac..0d1ceea 100644
--- a/modules/invoice/invoice.inc.php
+++ b/modules/invoice/invoice.inc.php
@@ -3755,7 +3755,7 @@ class invoice
                                if($value != '')
                                {
                                        $pat = "^" . $this->module . "_";
-                                       if(eregi($pat, $key))
+                                       if(preg_match('/'.$pat.'/i', $key))
                                        {
                                                $field = eregi_replace($pat,"",$key);
                                                if(eregi('%',$value))
@@ -4143,7 +4143,7 @@ class invoice
                        $order_by .= ' ASC';
                        $smarty_sort = 'asc=';
                } else {
-                       if (!eregi('date',$smarty_order)) {
+                       if (!preg_match('/date/i',$smarty_order)) {
                                $order_by .= ' ASC';
                                $smarty_sort = 'asc=';
                        } else {
@@ -4162,9 +4162,9 @@ class invoice
                          
                # generate the full query
                $db = &DB();
-               $q = eregi_replace("%%fieldList%%", $field_list, $search->sql);
-               $q = eregi_replace("%%tableList%%", AGILE_DB_PREFIX.$construct->table, $q);
-               $q = eregi_replace("%%whereList%%", "", $q);
+               $q = preg_replace("/%%fieldList%%/i", $field_list, $search->sql);
+               $q = preg_replace("/%%tableList%%/i", AGILE_DB_PREFIX.$construct->table, $q);
+               $q = preg_replace("/%%whereList%%/i", "", $q);
                $q .= " ".AGILE_DB_PREFIX . "invoice.site_id = '" . DEFAULT_SITE . "'";
                $q .= $order_by;
 
diff --git a/modules/product_cat/product_cat.inc.php b/modules/product_cat/product_cat.inc.php
index 1a7db9a..a7741d3 100644
--- a/modules/product_cat/product_cat.inc.php
+++ b/modules/product_cat/product_cat.inc.php
@@ -268,7 +268,7 @@ class product_cat
 
                # Get current id
                if(!empty($VAR['id'])) {
-                       $cid = ereg_replace(",","", $VAR['id']);
+                       $cid = preg_replace("/,/","", $VAR['id']);
                } else {
                        $current = '';
                }
@@ -369,7 +369,7 @@ class product_cat
 
                # Get current category id
                if(!empty($VAR['id'])) {
-                       $product_id = ereg_replace(",","", $VAR['id']);
+                       $product_id = preg_replace("/,/","", $VAR['id']);
                        $sql = $dbc->sql_select("product", "avail_category_id", "id = $product_id","", $db);
                        $product = $db->Execute($sql);
                        $current = unserialize($product->fields['avail_category_id']);
@@ -609,4 +609,4 @@ class product_cat
                $db->search_show($VAR, $this, $type);
        }                       
 }
-?>
\ No newline at end of file
+?>
diff --git a/modules/service/service.inc.php b/modules/service/service.inc.php
index d9074df..d2d7f4d 100644
--- a/modules/service/service.inc.php
+++ b/modules/service/service.inc.php
@@ -1364,7 +1364,7 @@ class service
                if(empty($VAR['clearall']) && empty($VAR['changeproduct'])) {
                        foreach($VAR as $key => $val) {
                                if(!empty($val)) {
-                                       $key = ereg_replace('^product_','', $key);
+                                       $key = preg_replace('/^product_/','', $key);
                                        if(is_array($val))
                                        $fields["$key"] = serialize($val);
                                        else
@@ -1888,4 +1888,4 @@ class service
                $this->limit    = $construct["construct"]["limit"];
        }
 }
-?>
\ No newline at end of file
+?>
diff --git a/modules/setup/setup.inc.php b/modules/setup/setup.inc.php
index 6f1592e..4272502 100644
--- a/modules/setup/setup.inc.php
+++ b/modules/setup/setup.inc.php
@@ -93,15 +93,15 @@ class setup
 
                # make sure the index.php file is not included at the end:
                if(!empty($VAR['setup_ssl_url']))
-                       $VAR['setup_ssl_url'] = eregi_replace('index.php', '', $VAR['setup_ssl_url']);
+                       $VAR['setup_ssl_url'] = preg_replace('/index.php/', '', $VAR['setup_ssl_url']);
                if(!empty($VAR['setup_nonssl_url']))
-                       $VAR['setup_nonssl_url'] = eregi_replace('index.php', '', $VAR['setup_nonssl_url']);                    
+                       $VAR['setup_nonssl_url'] = preg_replace('/index.php/', '', $VAR['setup_nonssl_url']);                   
 
                # Validate trailing slash is on the end of the URL:
-               if(!empty($VAR['setup_ssl_url']) && !ereg('/$', $VAR['setup_ssl_url']))
+               if(!empty($VAR['setup_ssl_url']) && !preg_match('/\/$/', $VAR['setup_ssl_url']))
                        $VAR['setup_ssl_url'] .= '/';           
                # Validate trailing slash is on the end of the URL:
-               if(!empty($VAR['setup_nonssl_url']) && !ereg('/$', $VAR['setup_nonssl_url']))
+               if(!empty($VAR['setup_nonssl_url']) && !preg_match('/\/$/', $VAR['setup_nonssl_url']))
                        $VAR['setup_nonssl_url'] .= '/';                                        
 
                $type = "update";
@@ -149,4 +149,4 @@ class setup
                phpinfo();
        }
 }
-?>
\ No newline at end of file
+?>
diff --git a/modules/ticket/ticket.inc.php b/modules/ticket/ticket.inc.php
index 05051b1..6392a4f 100644
--- a/modules/ticket/ticket.inc.php
+++ b/modules/ticket/ticket.inc.php
@@ -201,7 +201,7 @@ class ticket
        ##############################
        function merge_list($VAR)
        {
-               $id = ereg_replace(',','', $VAR['id']);
+               $id = preg_replace('/,/','', $VAR['id']);
 
                global $C_translate;
 
@@ -244,7 +244,7 @@ class ticket
                                $subject .= '..';
 
                                $return .= 'fields["date_orig"])) . ' | ' . $subject . ' ';
+                               $return .= '>' . preg_replace('/%/','', date(DEFAULT_DATE_FORMAT, $result->fields["date_orig"])) . ' | ' . $subject . ' ';
                                $i++;
                                $result->MoveNext();
                        }
@@ -1278,10 +1278,10 @@ class ticket
                                if($value != '')
                                {
                                        $pat = "^" . $this->module . "_";
-                                       if(eregi($pat, $key))
+                                       if(preg_match('/'.$pat.'/i', $key))
                                        {
-                                               $field = eregi_replace($pat,"",$key);
-                                               if(eregi('%',$value))
+                                               $field = preg_replace('/'.$pat.'/i',"",$key);
+                                               if(preg_match('/%/',$value))
                                                {
                                                        # do any data conversion for this field (date, encrypt, etc...)
                                                        if(isset($this->field["$field"]["convert"]))
@@ -1347,10 +1347,10 @@ class ticket
                                if($value != '')
                                {
                                        $pat = "^" . $this->module . "_";
-                                       if(eregi($pat, $key))
+                                       if(preg_match('/'.$pat.'/', $key))
                                        {
-                                               $field = eregi_replace($pat,"",$key);
-                                               if(eregi('%',$value))
+                                               $field = preg_replace('/'.$pat.'/i',"",$key);
+                                               if(preg_match('/%/i',$value))
                                                {
                                                        # do any data conversion for this field (date, encrypt, etc...)
                                                        if(isset($this->field["$field"]["convert"]))
@@ -1472,7 +1472,7 @@ class ticket
                                                        AND
                                                        s{$idx}.site_id = ".$db->qstr(DEFAULT_SITE)."                                                   
                                                        AND";
-                                       if(ereg("%", $value))
+                                       if(preg_match("/%/i", $value))
                                        $join_list .= " s{$idx}.value LIKE ".$db->qstr($VAR["static_relation"]["$idx"]);
                                        else
                                        $join_list .= " s{$idx}.value = ".$db->qstr($VAR["static_relation"]["$idx"]);
@@ -1652,7 +1652,7 @@ class ticket
                        $order_by .= ' ASC';
                        $smarty_sort = 'asc=';
                } else {
-                       if (!eregi('date',$smarty_order)) {
+                       if (!preg_match('/date/i',$smarty_order)) {
                                $order_by .= ' ASC';
                                $smarty_sort = 'asc=';
                        } else {
@@ -1665,9 +1665,9 @@ class ticket
                # generate the full query
 
                $db = &DB();
-               $q = eregi_replace("%%fieldList%%", $field_list, $search->sql);
-               $q = eregi_replace("%%tableList%%", AGILE_DB_PREFIX.$construct->table, $q);
-               $q = eregi_replace("%%whereList%%", "", $q);
+               $q = preg_replace("/%%fieldList%%/i", $field_list, $search->sql);
+               $q = preg_replace("/%%tableList%%/i", AGILE_DB_PREFIX.$construct->table, $q);
+               $q = preg_replace("/%%whereList%%/i", "", $q);
                $q .= " ".AGILE_DB_PREFIX . "ticket."."site_id = " . $db->qstr(DEFAULT_SITE);
                $q .= $order_by;
 
@@ -1780,7 +1780,7 @@ class ticket
                require_once(PATH_CORE   . 'static_var.inc.php');
                $static_var = new CORE_static_var;
 
-               if(ereg('search', $VAR['_page']))
+               if(preg_match('/search/', $VAR['_page']))
                $arr = $static_var->generate_form($this->module, 'user_add', 'search');
                else
                $arr = $static_var->generate_form($this->module, 'user_add', 'update');

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.