Changeset 5593


Ignore:
Timestamp:
03/01/12 10:37:23 (12 years ago)
Author:
wmerlotto
Message:

Ticket #2398 - Compatibilizacao com PHP-5.3 no modulo ExpressoAdmin

Location:
trunk/expressoAdmin1_2/inc
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.bomessages_size.inc.php

    r5144 r5593  
    7878                        } 
    7979                        /* Verifica se esse valor é um número */ 
    80                         if((!eregi("^[0-9]+$", $params['max_messages_size']))) 
     80                        if((!preg_match("/^[0-9]+$/i", $params['max_messages_size']))) 
    8181                        { 
    8282                                $result['status'] = false; 
     
    178178                        } 
    179179                        /* Verifica se esse valor é um número */ 
    180                         if((!eregi("^[0-9]+$", $params['max_messages_size']))) 
     180                        if((!preg_match('/^[0-9]+$/i', $params['max_messages_size']))) 
    181181                        { 
    182182                                $result['status'] = false; 
  • trunk/expressoAdmin1_2/inc/class.db_functions.inc.php

    r5509 r5593  
    5555        } 
    5656         
    57                 $all_contexts = split("%", $context); 
     57                $all_contexts = preg_split('/%/', $context); 
    5858                foreach ($all_contexts as $index=>$context) 
    5959                { 
  • trunk/expressoAdmin1_2/inc/class.functions.inc.php

    r5133 r5593  
    512512                                $array_dn = ldap_explode_dn($context, 1 ); 
    513513                                foreach($array_dn as $key=>$value){ 
    514                                         $array_dn[$key]=preg_replace("/\\\([0-9A-Fa-f]{2})/e", "''.chr(hexdec('\\1')).''",$value); 
     514                                        $array_dn[$key]=preg_replace('/\\\([0-9A-Fa-f]{2})/e', "''.chr(hexdec('\\1')).''",$value); 
    515515                                }        
    516516 
     
    725725 
    726726                        /* formato do CPF */ 
    727                         if (!(ereg("^[0-9]{3}[.][0-9]{3}[.][0-9]{3}[-][0-9]{2}$",$cpf))) 
     727                        if (!(preg_match('/^[0-9]{3}[.][0-9]{3}[.][0-9]{3}[-][0-9]{2}$/',$cpf))) 
    728728                                return false; 
    729729 
     
    732732 
    733733                        /*Retorna falso se houver letras no cpf */ 
    734                         if (!(ereg("[0-9]",$cpf))) 
     734                        if (!(preg_match('/[0-9]/',$cpf))) 
    735735                        return false; 
    736736 
     
    772772                function make_lang($ram_lang) 
    773773                { 
    774                         $a_lang = split("_", $ram_lang); 
     774                        $a_lang = preg_split('/_/', $ram_lang); 
    775775                        $a_lang_reverse  = array_reverse ( $a_lang, true ); 
    776776                        array_pop ( $a_lang_reverse ); 
  • trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php

    r5509 r5593  
    131131                } 
    132132 
    133                 if (! eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$", $params['mail']) ) 
     133                if (! preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/i', $params['mail']) ) 
    134134                { 
    135135                        $result['status'] = false; 
     
    235235                } 
    236236 
    237                 if (! eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$", $params['mail']) ) 
     237                if (! preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/i', $params['mail']) ) 
    238238                { 
    239239                        $result['status'] = false; 
     
    338338                } 
    339339 
    340                 if (! eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$", $params['mail']) ) 
     340                if (! preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/i', $params['mail']) ) 
    341341                { 
    342342                        $result['status'] = false; 
     
    461461                        } 
    462462         
    463                         if (! eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$", $params['mail']) ) 
     463                        if (! preg_match('/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+$/i', $params['mail']) ) 
    464464                        { 
    465465                                $result['status'] = false; 
     
    656656                        { 
    657657                                //Obtenho UID sem a organização. Na criação o uid já vem sem a organização 
    658                                 $tmp_uid_without_org = split("-", $params['uid']); 
     658                                $tmp_uid_without_org = preg_split('/-/', $params['uid']); 
    659659                                $tmp_reverse_uid_without_org = array_reverse($tmp_uid_without_org); 
    660660                                array_pop($tmp_reverse_uid_without_org); 
     
    671671                        { 
    672672                                //Obtenho UID sem a organização. Na criação o uid já vem sem a organização 
    673                                 $tmp_uid_without_org = split("-", $params['uid']); 
     673                                $tmp_uid_without_org = preg_split('/-/', $params['uid']); 
    674674                                $tmp_reverse_uid_without_org = array_reverse($tmp_uid_without_org); 
    675675                                array_pop($tmp_reverse_uid_without_org); 
     
    724724                                //Obtenho UID sem a organização 
    725725                                /* 
    726                                 $tmp_uid_without_org = split("-", $params['uid']); 
     726                                $tmp_uid_without_org = preg_split('/-/', $params['uid']); 
    727727                                if (count($tmp_uid_without_org) < 2) 
    728728                                { 
     
    26662666                else 
    26672667                { 
    2668                         $tmp_user_context = split(",", utf8_decode($entrie[0]['dn'])); 
     2668                        $tmp_user_context = preg_split('/,/', utf8_decode($entrie[0]['dn'])); 
    26692669                        $tmp_reverse_user_context = array_reverse($tmp_user_context); 
    26702670                        array_pop($tmp_reverse_user_context); 
     
    27602760                else 
    27612761                { 
    2762                         $tmp_user_context = split(",", $entrie[0]['dn']); 
     2762                        $tmp_user_context = preg_split('/,/', $entrie[0]['dn']); 
    27632763                        $tmp_reverse_user_context = array_reverse($tmp_user_context); 
    27642764                        array_pop($tmp_reverse_user_context); 
  • trunk/expressoAdmin1_2/inc/class.manager.inc.php

    r5133 r5593  
    7474                        $return['status'] = 'true'; 
    7575                         
    76                         $contexts = split("%", $params['contexts']); 
     76                        $contexts = preg_split('/%/', $params['contexts']); 
    7777                        $manager_lid = $params['manager_lid']; 
    7878                        $type = $params['type']; 
  • trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php

    r5220 r5593  
    132132                        { 
    133133                                // limit query to limit characters 
    134                                 if(eregi('^[a-z_0-9_-].+$',$_POST['query']))  
     134                                if(preg_match('/^[a-z_0-9_-].+$/i',$_POST['query']))  
    135135                                { 
    136136                                        $GLOBALS['query'] = $_POST['query']; 
  • trunk/expressoAdmin1_2/inc/class.uicomputers.inc.php

    r414 r5593  
    6767                        { 
    6868                                // limit query to limit characters 
    69                                 if(eregi('^[a-z_0-9_-].+$',$_POST['query']))  
     69                                if(preg_match('/^[a-z_0-9_-].+$/i',$_POST['query']))  
    7070                                { 
    7171                                        $GLOBALS['query'] = $_POST['query']; 
  • trunk/expressoAdmin1_2/inc/class.uigroups.inc.php

    r5133 r5593  
    6868                        { 
    6969                                // limit query to limit characters 
    70                                 if(eregi('^[a-z_0-9_-].+$',$_POST['query']))  
     70                                if(preg_match('/^[a-z_0-9_-].+$/i',$_POST['query']))  
    7171                                        $GLOBALS['query'] = $_POST['query']; 
    7272                        } 
  • trunk/expressoAdmin1_2/inc/class.uilogs.inc.php

    r414 r5593  
    125125                                         
    126126                                        //Date treatment 
    127                                         $a_date = split(" ", $log['date']); 
    128                                         $a_day = split("-", $a_date[0]); 
     127                                        $a_date = preg_split('/ /', $log['date']); 
     128                                        $a_day = preg_split('/-/', $a_date[0]); 
    129129                                        $a_day_tmp = array_reverse($a_day); 
    130130                                        $a_day = join($a_day_tmp, "/"); 
    131                                         $a_hour = split("\.", $a_date[1]); 
     131                                        $a_hour = preg_split('/\./', $a_date[1]); 
    132132                                         
    133133                                        $var = array( 
  • trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php

    r5133 r5593  
    6464                        { 
    6565                                // limit query to limit characters 
    66                                 if(eregi('^[a-z_0-9_%-].+$',$_POST['query']))  
     66                                if(preg_match('/^[a-z_0-9_%-].+$/i',$_POST['query']))  
    6767                                        $GLOBALS['query'] = $_POST['query']; 
    6868                        } 
  • trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php

    r5133 r5593  
    102102                                { 
    103103                                        $managers_context = ""; 
    104                                         $a_managers_context = split("%", $array_managers['context']); 
     104                                        $a_managers_context = preg_split('/%/', $array_managers['context']); 
    105105 
    106106                                        foreach ($a_managers_context as $context) 
     
    156156                        if ($_POST['context']) 
    157157                        { 
    158                                 $contexts = split("%", $_POST['context']); 
     158                                $contexts = preg_split('/%/', $_POST['context']); 
    159159                                foreach ($contexts as $manager_context) 
    160160                                        $input_context_fields .= "<input type='text' size=60 value=$manager_context></input><br>"; 
     
    292292                        $applications_list = $this->make_app_list($manager[0]['apps']); 
    293293 
    294                         $a_context = split("%", $_POST['context']); 
     294                        $a_context = preg_split('/%/', $_POST['context']); 
    295295                        foreach ($a_context as $context) 
    296296                                $input_context_fields .= '<div><input disabled type="text" value="'.$context.'" size=60></input><span onclick="this.parentNode.parentNode.removeChild(this.parentNode);" style="cursor:pointer"> -</span></div>'; 
     
    346346                function make_lang($ram_lang) 
    347347                { 
    348                         $a_lang = split("_", $ram_lang); 
     348                        $a_lang = preg_split('/_/', $ram_lang); 
    349349                        $a_lang_reverse  = array_reverse ( $a_lang, true ); 
    350350                        //Retira o lang do array. 
  • trunk/expressoAdmin1_2/inc/class.user.inc.php

    r5133 r5593  
    10721072                                $sk = fsockopen ($imap_server,$imap_port); 
    10731073                                $server_resp = fread($sk, 100); 
    1074                         $tmp = split('v2.', $server_resp); 
     1074                        $tmp = preg_split('/v2./', $server_resp); 
    10751075                        $cyrus_version = '2' . $tmp[1][0]; 
    10761076                         
  • trunk/expressoAdmin1_2/inc/sieve-php.lib.php

    r506 r5593  
    121121 
    122122    $this->line=fgets($this->fp,1024); 
    123     $this->token = split(" ", $this->line, 2); 
     123    $this->token = preg_split('/ /', $this->line, 2); 
    124124 
    125125    if($this->token[0] == "NO"){ 
     
    127127           NO ("yyyyy") "zzzzzzz" or, two, NO {yyyyy} "zzzzzzzzzzz" */ 
    128128        $this->x = 0; 
    129         list($this->ltoken, $this->mtoken, $this->rtoken) = split(" ", $this->line." ", 3); 
     129        list($this->ltoken, $this->mtoken, $this->rtoken) = preg_split('/ /', $this->line." ", 3); 
    130130        if($this->mtoken[0] == "{"){ 
    131131            while($this->mtoken[$this->x] != "}" or $this->err_len < 1){ 
     
    372372    //So, if we see IMLEMENTATION in the first line, then we are done. 
    373373 
    374     if(ereg("IMPLEMENTATION",$this->line)) 
     374    if(preg_match('/IMPLEMENTATION/',$this->line)) 
    375375    { 
    376376      //we're on the Cyrus V2 sieve server 
     
    389389                  $this->cap_type="auth";             
    390390 
    391               $this->modules = split(" ", $this->item[1]); 
     391              $this->modules = preg_split('/ /', $this->item[1]); 
    392392              if(is_array($this->modules)){ 
    393393                  foreach($this->modules as $this->module) 
     
    422422 
    423423        //then split again at the ", " stuff. 
    424         $this->modules = split($this->modules, ", "); 
     424        $this->modules = preg_split("/$this->modules/", ', '); 
    425425  
    426426        //fill up our $this->modules property 
     
    767767    //So, if we see IMLEMENTATION in the first line, then we are done. 
    768768 
    769     if(ereg("IMPLEMENTATION",$this->line)) 
     769    if(preg_match('/IMPLEMENTATION/',$this->line)) 
    770770    { 
    771771      //we're on the Cyrus V2 sieve server 
     
    784784                  $this->cap_type="auth";             
    785785 
    786               $this->modules = split(" ", $this->item[1]); 
     786              $this->modules = preg_split('/ /', $this->item[1]); 
    787787              if(is_array($this->modules)){ 
    788788                  foreach($this->modules as $this->module) 
     
    814814 
    815815        //then split again at the ", " stuff. 
    816         $this->modules = split($this->modules, ", "); 
     816        $this->modules = preg_split("/$this->modules/", ', '); 
    817817  
    818818        //fill up our $this->modules property 
Note: See TracChangeset for help on using the changeset viewer.