Changeset 5934


Ignore:
Timestamp:
04/12/12 15:18:08 (12 years ago)
Author:
marcosw
Message:

Ticket #2398 - Compatibilizacao com PHP-5.3 em alguns módulos do expresso

Location:
trunk
Files:
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/csv_import.php

    r5915 r5934  
    5858        $PSep = '||'; // Pattern-Separator, separats the pattern-replacement-pairs in trans 
    5959        $ASep = '|>'; // Assignment-Separator, separats pattern and replacesment 
    60         $VPre = '|#'; // Value-Prefix, is expanded to \ for ereg_replace 
     60        $VPre = '|#'; // Value-Prefix, is expanded to \ for preg_replace 
    6161        $CPre = '|['; $CPreReg = '\|\['; // |{csv-fieldname} is expanded to the value of the csv-field 
    6262        $CPos = ']';  $CPosReg = '\]';  // if used together with @ (replacement is eval-ed) value gets autom. quoted 
     
    244244                        "First example: <b>1${ASep}private${PSep}public</b><br>". 
    245245                        "This will translate a '1' in the CVS field to 'private' and everything else to 'public'.<p>". 
    246                         "Patterns as well as the replacement can be regular expressions (the replacement is done via ereg_replace). ". 
     246                        "Patterns as well as the replacement can be regular expressions (the replacement is done via preg_replace). ". 
    247247                        "If, after all replacements, the value starts with an '@' the whole value is eval()'ed, so you ". 
    248248                        "may use all php, phpgw plus your own functions. This is quiet powerfull, but <u>circumvents all ACL</u>.<p>". 
     
    375375                                                if (preg_match("/$pattern/",$val)) 
    376376                                                { 
    377                                                         // echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; 
    378                                                         $val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); 
     377                                                        // echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",preg_replace("/$pattern/",'$replace','$val') = "; 
     378                                                        $val = preg_replace((string) "/$pattern/",str_replace($VPre,'\\',$replace),(string) $val); 
    379379                                                        // echo "'$val'</p>"; 
    380380 
     
    462462                                        { 
    463463                                                // convert german DD.MM.YYYY format into ISO YYYY-MM-DD format 
    464                                                 $values[$date] = ereg_replace('([0-9]{2}).([0-9]{2}).([0-9]{4})','\3-\2-\1',$values[$date]); 
     464                                                $values[$date] = preg_replace('/([0-9]{2}).([0-9]{2}).([0-9]{4})/','\3-\2-\1',$values[$date]); 
    465465                                                // remove fractures of seconds if present at the end of the string 
    466466                                                if (preg_match('/(.*)\.[0-9]+/',$values[$date],$parts)) $values[$date] = $parts[1]; 
  • trunk/expressoAdmin1_2/inc/class.functions.inc.php

    r5593 r5934  
    729729 
    730730                        /* Retira todos os caracteres que nao sejam 0-9 */ 
    731                         $cpf = ereg_replace("[^0-9]", "", $cpf); 
     731                        $cpf = preg_replace('/[^0-9]/', '', $cpf); 
    732732 
    733733                        /*Retorna falso se houver letras no cpf */ 
  • trunk/expressoAdmin1_2/inc/class.ldap_functions.inc.php

    r5593 r5934  
    818818                                { 
    819819                                        //retira caracteres que não são números. 
    820                                         $cpf = ereg_replace("[^0-9]", "", $cpf); 
     820                                        $cpf = preg_replace('/[^0-9]/', '', $cpf); 
    821821                                 
    822822                                        $local_ldap_connection = ldap_connect($GLOBALS['phpgw_info']['server']['ldap_host']); 
  • trunk/expressoAdmin1_2/inc/class.login_algorithm_example.inc.php

    r594 r5934  
    9292                //Retira acentos e caracteres especiais, e substitui espaço em branco pelo caracter #. 
    9393                private function formata_frase($frase) {                 
    94                         $frase = ereg_replace("[^a-zA-Z0-9#.]", "",  
     94                        $frase = preg_replace('/[^a-zA-Z0-9#.]/', '',  
    9595                          strtr($frase, "áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ ",  
    9696                          "aaaaeeiooouucAAAAEEIOOOUUC#")); 
  • trunk/expressoMail1_2/inc/class.exporteml.inc.php

    r5773 r5934  
    6666                $subject = substr($subject, 0, 59); 
    6767  
    68                         //$subject = ereg_replace('/', '\'', $subject); 
     68                        //$subject = preg_replace('/\//', '\'', $subject); 
    6969                        $from = "áàâãäéèêëíìîïóòôõöúùûüç?\"!@#$%š&*()-=+Ž`[]{}~^,<>;:/?\\|¹²³£¢¬§ªº° .ÁÀÂÃÄÉÈÊËÍÌÎÏÓÒÔÕÖÚÙÛÜÇ"; 
    7070                        $to =   "aaaaaeeeeiiiiooooouuuuc______________________________________________AAAAAEEEEIIIIOOOOOUUUUC"; 
  • trunk/expressoMail1_2/login_offline.php

    r5912 r5934  
    339339        if (count($GLOBALS['phpgw_info']['server']['login_logo_file']) > 0) { 
    340340                $logo_config = $GLOBALS['phpgw_info']['server']['login_logo_file']; 
    341                 $logo_config = ereg_replace("phpgwapi/","../phpgwapi/",$logo_config); 
     341                $logo_config = preg_replace('/phpgwapi\//','../phpgwapi/',$logo_config); 
    342342                $tmpl->set_var('logo_config',$logo_config);      
    343343        } 
  • trunk/filemanager/inc/after_upload.php

    r5327 r5934  
    2828                $String = str_replace( "ç", "c", $String ); 
    2929                $String = str_replace( "Ç", "C", $String ); 
    30                 $String = ereg_replace( "[áàâã]", "a", $String ); 
    31                 $String = ereg_replace( "[ÁÀÂÃ]", "A", $String ); 
    32                 $String = ereg_replace( "[éÚê]", "e", $String ); 
    33                 $String = ereg_replace( "[ÉÈÊ]", "E", $String ); 
    34                 $String = ereg_replace( "[íìîï]", "i", $String ); 
    35                 $String = ereg_replace( "[ÍÌÎ]", "I", $String ); 
    36                 $String = ereg_replace( "[óòÎõ]", "o", $String ); 
    37                 $String = ereg_replace( "[ÓÒÔÕ]", "O", $String ); 
    38                 $String = ereg_replace( "[úùû]", "u", $String ); 
    39                 $String = ereg_replace( "[ÚÙÛ]", "U", $String ); 
     30                $String = preg_replace( '/[áàâã]/', "a", $String ); 
     31                $String = preg_replace( '/[ÁÀÂÃ]/', "A", $String ); 
     32                $String = preg_replace( '/[éÚê]/', "e", $String ); 
     33                $String = preg_replace( '/[ÉÈÊ]/', "E", $String ); 
     34                $String = preg_replace( '/[íìîï]/', "i", $String ); 
     35                $String = preg_replace( '/[ÍÌÎ]/', "I", $String ); 
     36                $String = preg_replace( '/[óòÎõ]/', "o", $String ); 
     37                $String = preg_replace( '/[ÓÒÔÕ]/', "O", $String ); 
     38                $String = preg_replace( '/[úùû]/', "u", $String ); 
     39                $String = preg_replace( '/[ÚÙÛ]/', "U", $String ); 
    4040                 
    4141                return $String; 
  • trunk/phpgwapi/inc/class.jscalendar.inc.php

    r771 r5934  
    3737'<link rel="stylesheet" type="text/css" media="all" href="'.$this->jscalendar_url.'/calendar-win2k-cold-1.css" title="" /> 
    3838<script type="text/javascript" src="'.$this->jscalendar_url.'/calendar.js"></script> 
    39 <script type="text/javascript" src="'.ereg_replace('[?&]*click_history=[0-9a-f]*','',$GLOBALS['phpgw']->link('/phpgwapi/inc/jscalendar-setup.php')).'"></script> 
     39<script type="text/javascript" src="'.preg_replace('/[?&]*click_history=[0-9a-f]*/','',$GLOBALS['phpgw']->link('/phpgwapi/inc/jscalendar-setup.php')).'"></script> 
    4040'; 
    4141                        } 
  • trunk/phpgwapi/inc/class.ping.inc.php

    r2 r5934  
    7272                        $packet_tx   = str_replace(' packets transmitted','',$values[0]); 
    7373                        $packet_rx   = str_replace(' packets received','',$values[1]); 
    74                         $packet_loss = ereg_replace('% packet loss','',$values[2]); 
     74                        $packet_loss = preg_replace('/% packet loss/','',$values[2]); 
    7575 
    7676                        $this->packet_tx   = (int)str_replace(' ','',$packet_tx); 
  • trunk/phpgwapi/inc/class.schema_proc_mysql.inc.php

    r2 r5934  
    242242                                /* The rest of this is used only for SQL->array */ 
    243243                                $colinfo = explode('(',$oProc->m_odb->f(1)); 
    244                                 $prec = ereg_replace('\).*','',$colinfo[1]); 
     244                                $prec = preg_replace('/\).*/','',$colinfo[1]); 
    245245                                $scales = explode(',',$prec); 
    246246 
  • trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php

    r3614 r5934  
    378378                        @$oProc->m_odb->query($sql); 
    379379                        $oProc->m_odb->next_record(); 
    380                         $indexfields = ereg_replace("^CREATE.+\(",'',$oProc->m_odb->f($num)); 
    381                         $indexfields = ereg_replace("\)$",'',$indexfields); 
     380                        $indexfields = preg_replace('/^CREATE.+\(/','',$oProc->m_odb->f($num)); 
     381                        $indexfields = preg_replace('/\)$/','',$indexfields); 
    382382                        $aIx = explode(',',$indexfields); 
    383383                        $i = 0; 
  • trunk/phpgwapi/inc/class.soap_server.inc.php

    r5912 r5934  
    9898                                elseif(preg_match('/.php/',$action)) 
    9999                                { 
    100                                         $this->service = ereg_replace('"|/','',substr(strrchr($action,".php"),4,strlen(strrchr($action,"/")))); 
     100                                        $this->service = preg_replace('/"|\//','',substr(strrchr($action,".php"),4,strlen(strrchr($action,"/")))); 
    101101                                } 
    102102                                $this->debug("got service: $this->service"); 
     
    116116 
    117117                        // does method exist? 
    118                         $test = ereg_replace("\.",'_',$this->methodname); 
     118                        $test = preg_replace('/\./','_',$this->methodname); 
    119119                        if(function_exists($test)) 
    120120                        { 
  • trunk/phpgwapi/inc/class.soapmsg.inc.php

    r5921 r5934  
    121121                        //$this->debug(" w/ data $data"); 
    122122                        // strip headers here 
    123                         //$clean_data = ereg_replace("\r\n","\n", $data); 
     123                        //$clean_data = preg_replace('/\r\n/','\n', $data); 
    124124                        if(preg_match('/^.*\r\n\r\n</',$data)) 
    125125                        { 
    126126                                $this->debug("found proper seperation of headers and document"); 
    127127                                $this->debug("getting rid of headers, stringlen: ".strlen($data)); 
    128                                 $clean_data = ereg_replace("^.*\r\n\r\n<","<", $data); 
     128                                $clean_data = preg_replace('/^.*\r\n\r\n</','<', $data); 
    129129                                $this->debug("cleaned data, stringlen: ".strlen($clean_data)); 
    130130                        } 
  • trunk/phpgwapi/inc/class.validator.inc.php

    r5928 r5934  
    5050                function strip_space ($text) 
    5151                { 
    52                         return ereg_replace("( |\n|\t|\r)+", '', $text); 
     52                        return preg_replace('/( |\n|\t|\r)+/', '', $text); 
    5353                } 
    5454 
  • trunk/phpgwapi/inc/class.vcard.inc.php

    r2 r5934  
    217217                        { 
    218218                                $field  = split(';',$name); 
    219                                 $field[0] = ereg_replace("A\.",'',$field[0]); 
    220                                 $field[0] = ereg_replace("B\.",'',$field[0]); 
    221                                 $field[0] = ereg_replace("C\.",'',$field[0]); 
    222                                 $field[0] = ereg_replace("D\.",'',$field[0]); 
     219                                $field[0] = preg_replace('/A\./','',$field[0]); 
     220                                $field[0] = preg_replace('/B\./','',$field[0]); 
     221                                $field[0] = preg_replace('/C\./','',$field[0]); 
     222                                $field[0] = preg_replace('/D\./','',$field[0]); 
    223223                                $values = split(';',$value); 
    224224                                if($field[1]) 
  • trunk/phpgwapi/inc/xml_functions.inc.php

    r5912 r5934  
    153153                        if (preg_match('/^([#a-zA-Z0-9]+);/', $top[$i], $regs)) 
    154154                        { 
    155                                 $op .= ereg_replace("^[#a-zA-Z0-9]+;", 
     155                                $op .= preg_replace('/^[#a-zA-Z0-9]+;/', 
    156156                                        xmlrpc_lookup_entity($regs[1]), $top[$i]); 
    157157                        } 
     
    360360                                break; 
    361361                        case 'METHODNAME': 
    362                                 $GLOBALS['_xh'][$parser]['method']=ereg_replace("^[\n\r\t ]+", "", $GLOBALS['_xh'][$parser]['ac']); 
     362                                $GLOBALS['_xh'][$parser]['method']=preg_replace('/^[\n\r\t ]+/', '', $GLOBALS['_xh'][$parser]['ac']); 
    363363                                break; 
    364364                        case 'BOOLEAN': 
  • trunk/reports/inc/class.uireports_cota.inc.php

    r5291 r5934  
    101101                        // Save query 
    102102                        $varorganizacao = explode(",",$contextsdn); 
    103                         $varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0]))); 
    104                         $varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome))); 
     103                        $varorganizacao_nome = trim(strtoupper(preg_replace('/ou=/','',$varorganizacao[0]))); 
     104                        $varorganizacao_nome = trim(strtoupper(preg_replace('/DC=/','',$varorganizacao_nome))); 
    105105                        $user_logon = $GLOBALS['phpgw_info']['user'][account_lid]; 
    106106 
     
    137137                                                if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector))) 
    138138                                                { 
    139                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sector))); 
    140                                                         $sectorok = trim(strtoupper(ereg_replace("DC=","",$sectorok))); 
     139                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/',"",$sector))); 
     140                                                        $sectorok = trim(strtoupper(preg_replace('/DC=/',"",$sectorok))); 
    141141                                                        $sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>"; 
    142142                                                } 
     
    205205                { 
    206206                        $grouplist = trim($_POST[setor]); 
    207                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     207                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    208208                        $organizacao = trim($_POST[organizacao]); 
    209209                        $setordn = trim($_POST[setordn]); 
     
    514514 
    515515                        $grouplist = trim($_POST[setor]); 
    516                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     516                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    517517 
    518518                        $setordn = trim($_POST[setordn]); 
  • trunk/reports/inc/class.uireports_logon.inc.php

    r5291 r5934  
    6767 
    6868                        $grouplist = trim($_POST[setor]); 
    69                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     69                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    7070 
    7171                        $setordn = trim($_POST[setordn]); 
     
    286286                        // Save query 
    287287                        $varorganizacao = explode(",",$contextsdn); 
    288                         $varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0]))); 
    289                         $varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome))); 
     288                        $varorganizacao_nome = trim(strtoupper(preg_replace('/ou=/','',$varorganizacao[0]))); 
     289                        $varorganizacao_nome = trim(strtoupper(preg_replace('/DC=/','',$varorganizacao_nome))); 
    290290                        $user_logon = $GLOBALS['phpgw_info']['user'][account_lid]; 
    291291 
     
    329329                                                if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector))) 
    330330                                                { 
    331                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sector))); 
    332                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok))); 
     331                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sector))); 
     332                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sectorok))); 
    333333                                                        $sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>"; 
    334334                                                } 
     
    403403 
    404404                        $grouplist = trim($_POST[setor]); 
    405                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     405                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    406406                        $organizacao = trim($_POST[organizacao]); 
    407407                        $setordn = trim($_POST[setordn]); 
  • trunk/reports/inc/class.uireports_maillists.inc.php

    r5291 r5934  
    6666 
    6767                        $grouplist = trim($_POST[setor]); 
    68                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     68                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    6969 
    7070                        $setordn = trim($_POST[setordn]); 
     
    192192                        // Save query 
    193193                        $varorganizacao = explode(",",$contextsdn); 
    194                         $varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0]))); 
    195                         $varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome))); 
     194                        $varorganizacao_nome = trim(strtoupper(preg_replace('/ou=/','',$varorganizacao[0]))); 
     195                        $varorganizacao_nome = trim(strtoupper(preg_replace('/DC=/','',$varorganizacao_nome))); 
    196196                        $user_logon = $GLOBALS['phpgw_info']['user'][account_lid]; 
    197197 
     
    235235                                                if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector))) 
    236236                                                { 
    237                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sector))); 
    238                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok))); 
     237                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sector))); 
     238                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sectorok))); 
    239239                                                        $sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>"; 
    240240                                                } 
     
    301301                { 
    302302                        $grouplist = trim($_POST[setor]); 
    303                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     303                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    304304                        $organizacao = trim($_POST[organizacao]); 
    305305                        $setordn = trim($_POST[setordn]); 
  • trunk/reports/inc/class.uireports_users.inc.php

    r5291 r5934  
    6666 
    6767                        $grouplist = trim($_POST[setor]); 
    68                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     68                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    6969 
    7070                        $setordn = trim($_POST[setordn]); 
     
    211211                        // Save query 
    212212                        $varorganizacao = explode(",",$contextsdn); 
    213                         $varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0]))); 
    214                         $varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome))); 
     213                        $varorganizacao_nome = trim(strtoupper(preg_replace('/ou=/','',$varorganizacao[0]))); 
     214                        $varorganizacao_nome = trim(strtoupper(preg_replace('/DC=/','',$varorganizacao_nome))); 
    215215                        $user_logon = $GLOBALS['phpgw_info']['user'][account_lid]; 
    216216 
     
    254254                                                if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector))) 
    255255                                                { 
    256                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sector))); 
    257                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok))); 
     256                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sector))); 
     257                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sectorok))); 
    258258                                                        $sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>"; 
    259259                                                } 
     
    320320                { 
    321321                        $grouplist = trim($_POST[setor]); 
    322                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     322                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    323323                        $organizacao = trim($_POST[organizacao]); 
    324324                        $setordn = trim($_POST[setordn]); 
  • trunk/reports/inc/class.uireports_usersgroups.inc.php

    r5291 r5934  
    6666 
    6767                        $grouplist = trim($_POST[setor]); 
    68                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     68                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    6969 
    7070                        $setordn = trim($_POST[setordn]); 
     
    189189                        // Save query 
    190190                        $varorganizacao = explode(",",$contextsdn); 
    191                         $varorganizacao_nome = trim(strtoupper(ereg_replace("ou=","",$varorganizacao[0]))); 
    192                         $varorganizacao_nome = trim(strtoupper(ereg_replace("DC=","",$varorganizacao_nome))); 
     191                        $varorganizacao_nome = trim(strtoupper(preg_replace('/ou=/','',$varorganizacao[0]))); 
     192                        $varorganizacao_nome = trim(strtoupper(preg_replace('/DC=/','',$varorganizacao_nome))); 
    193193                        $user_logon = $GLOBALS['phpgw_info']['user'][account_lid]; 
    194194 
     
    232232                                                if ( trim(strtoupper($varorganizacao_nome)) !=  trim(strtoupper($sector))) 
    233233                                                { 
    234                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sector))); 
    235                                                         $sectorok = trim(strtoupper(ereg_replace("dc=","",$sectorok))); 
     234                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sector))); 
     235                                                        $sectorok = trim(strtoupper(preg_replace('/dc=/','',$sectorok))); 
    236236                                                        $sector_options .= "<option value='" . $sectordn . "'>". $sectorok . "</option>"; 
    237237                                                } 
     
    298298                { 
    299299                        $grouplist = trim($_POST[setor]); 
    300                         $grouplist = trim(ereg_replace("-","",$grouplist)); 
     300                        $grouplist = trim(preg_replace('/-/','',$grouplist)); 
    301301                        $organizacao = trim($_POST[organizacao]); 
    302302                        $setordn = trim($_POST[setordn]); 
  • trunk/workflow/inc/class.BrowserInfo.inc.php

    r5928 r5934  
    271271 
    272272                // clean up extraneous garbage that may be in the name 
    273                 $bd['browser'] = ereg_replace("[^a-z,A-Z]", "", $bd['browser']); 
     273                $bd['browser'] = preg_replace('/[^a-z,A-Z]/', '', $bd['browser']); 
    274274                // clean up extraneous garbage that may be in the version 
    275                 $bd['version'] = ereg_replace("[^0-9,.,a-z,A-Z]", "", $bd['version']); 
     275                $bd['version'] = preg_replace('/[^0-9,.,a-z,A-Z]/', '', $bd['version']); 
    276276 
    277277                // check for AOL 
     
    280280                        $var = stristr($agent, "AOL"); 
    281281                        $var = explode(" ", $var); 
    282                         $bd['aol'] = ereg_replace("[^0-9,.,a-z,A-Z]", "", $var[1]); 
     282                        $bd['aol'] = preg_replace('/[^0-9,.,a-z,A-Z]/', '', $var[1]); 
    283283                } 
    284284 
  • trunk/workflow/inc/class.utils.php

    r795 r5934  
    389389                } 
    390390                foreach ($jsEvents as $event => $action) 
    391                         $scriptStr .= " $event=\"" . ereg_replace("\"", "'", $action) . "\""; 
     391                        $scriptStr .= " $event=\"" . preg_replace("/\"/", "'", $action) . "\""; 
    392392                return sprintf("<a href=\"%s\"%s%s%s%s%s%s%s%s>%s</a>", htmlentities($url), 
    393393                        (!empty($name) ? " name=\"{$name}\"" : ""), 
  • trunk/workflow/inc/class.utils.string.php

    r795 r5934  
    3030         */ 
    3131        function stripBlank($str, $replace=' ') { 
    32                 return ereg_replace("[[:blank:]]{1,}", $replace, $str); 
     32                return preg_replace('/[[:blank:]]{1,}/', $replace, $str); 
    3333        } 
    3434         
     
    405405                switch ($filterType) { 
    406406                        case 'alpha' : 
    407                                 return (ereg_replace("[^a-zA-Z]", $replaceStr, $str)); 
     407                                return (preg_replace('/[^a-zA-Z]/', $replaceStr, $str)); 
    408408                        case 'alphalower' : 
    409                                 return (ereg_replace("[^a-z]", $replaceStr, $str)); 
     409                                return (preg_replace('/[^a-z]/', $replaceStr, $str)); 
    410410                        case 'alphaupper' : 
    411                                 return (ereg_replace("[^A-Z]", $replaceStr, $str)); 
     411                                return (preg_replace('/[^A-Z]/', $replaceStr, $str)); 
    412412                        case 'num' : 
    413                                 return (ereg_replace("[^0-9]", $replaceStr, $str)); 
     413                                return (preg_replace('/[^0-9]/', $replaceStr, $str)); 
    414414                        case 'alphanum' : 
    415                                 return (ereg_replace("[^0-9a-zA-Z]", $replaceStr, $str)); 
     415                                return (preg_replace('/[^0-9a-zA-Z]/', $replaceStr, $str)); 
    416416                        case 'htmlentities' : 
    417                                 return (ereg_replace("&[[:alnum:]]{0,};", $replaceStr, $str)); 
     417                                return (preg_replace('/&[[:alnum:]]{0,};/', $replaceStr, $str)); 
    418418                        case 'blank' : 
    419                                 return (ereg_replace("[[:blank:]]{1,}", $replaceStr, $str)); 
     419                                return (preg_replace('/[[:blank:]]{1,}/', $replaceStr, $str)); 
    420420                        default : 
    421421                                return $str; 
     
    625625         */ 
    626626        function wrap($str, $num, $breakString="\n") { 
    627                 $str = ereg_replace("([^\r\n])\r\n([^\r\n])", "\\1 \\2", $str); 
    628                 $str = ereg_replace("[\r\n]*\r\n[\r\n]*", "\r\n\r\n", $str); 
    629                 $str = ereg_replace("[ ]* [ ]*", ' ', $str); 
     627                $str = preg_replace('/([^\r\n])\r\n([^\r\n])/', "\\1 \\2", $str); 
     628                $str = preg_replace('/[\r\n]*\r\n[\r\n]*/', "\r\n\r\n", $str); 
     629                $str = preg_replace('/[ ]* [ ]*/', ' ', $str); 
    630630                $str = stripslashes($str); 
    631631                $processed = ''; 
  • trunk/workflow/inc/phplot/phplot.php

    r5928 r5934  
    941941        else { 
    942942            // Split the text by its lines, and count them 
    943             $which_text = ereg_replace("\r", "", $which_text); 
     943            $which_text = preg_replace('/\r/', '', $which_text); 
    944944            $str = split("\n", $which_text); 
    945945            $nlines = count($str); 
Note: See TracChangeset for help on using the changeset viewer.