Changeset 5912


Ignore:
Timestamp:
04/11/12 12:04:21 (12 years ago)
Author:
marcosw
Message:

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

Location:
trunk
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/inc/class.boaccess_history.inc.php

    r2 r5912  
    5454                                } 
    5555 
    56                                 if (ereg('@',$record['loginid'])) 
     56                                if (preg_match('/@/',$record['loginid'])) 
    5757                                { 
    5858                                        $t = split('@',$record['loginid']); 
  • trunk/admin/inc/class.bocurrentsessions.inc.php

    r2 r5912  
    3131                        while (list(,$value) = @each($values)) 
    3232                        { 
    33                                 if (ereg('@',$value['session_lid'])) 
     33                                if (preg_match('/@/',$value['session_lid'])) 
    3434                                { 
    3535                                        $t = split('@',$value['session_lid']); 
  • trunk/calendar/csv_import.php

    r204 r5912  
    373373                                        foreach($trans[$csv_idx] as $pattern => $replace) 
    374374                                        { 
    375                                                 if (ereg((string) $pattern,$val)) 
     375                                                if (preg_match((string) '/'.$pattern.'/',$val)) 
    376376                                                { 
    377377                                                        // echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; 
     
    380380 
    381381                                                        $reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg; 
    382                                                         while (ereg($reg,$val,$vars)) 
     382                                                        while (preg_match('/'.$reg.'/',$val,$vars)) 
    383383                                                        {       // expand all CSV fields 
    384384                                                                $val = str_replace($CPre.$vars[1].$CPos,$val[0] == '@' ? "'".addslashes($fields[array_search($vars[1],$csv_fields)])."'" : $fields[array_search($vars[1],$csv_fields)],$val); 
     
    464464                                                $values[$date] = ereg_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 
    466                                                 if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1]; 
     466                                                if (preg_match('/(.*)\.[0-9]+/',$values[$date],$parts)) $values[$date] = $parts[1]; 
    467467                                                $values[$date] = strtotime($values[$date]); 
    468468                                        } 
  • trunk/contactcenter/inc/class.abo_catalog.inc.php

    r5131 r5912  
    356356                                                for($k = 0; $k < $n_joins; $k++) 
    357357                                                { 
    358                                                         if (ereg($query_join_reg,$query_fields_joins[$k])) 
     358                                                        if (preg_match('/'.$query_join_reg.'/',$query_fields_joins[$k])) 
    359359                                                        {        
    360360                                                                $unique = false; 
     
    430430                                                for($k = 0; $k < $n_joins; $k++) 
    431431                                                { 
    432                                                         if (ereg($query_join_reg,$query_restric_joins[$k])) 
     432                                                        if (preg_match('/'.$query_join_reg.'/',$query_restric_joins[$k])) 
    433433                                                        {        
    434434                                                                $unique = false; 
  • trunk/contactcenter/inc/class.ui_preferences.inc.php

    r3707 r5912  
    122122                        foreach($vars as $name => $value) 
    123123                        { 
    124                                 if (ereg('^lang_', $name) !== false) 
     124                                if (preg_match('/^lang_/', $name) !== false) 
    125125                                { 
    126126                                        $GLOBALS['phpgw']->template->set_var($name, lang(str_replace('_',' ',substr($name, 5)))); 
  • trunk/expressoMail1_2/login_offline.php

    r1932 r5912  
    251251        /*foreach($_GET as $name => $value) 
    252252        { 
    253                 if(ereg('phpgw_',$name)) 
     253                if(preg_match('/phpgw_/',$name)) 
    254254                { 
    255255                        $extra_vars .= '&' . $name . '=' . urlencode($value); 
  • trunk/filemanager/inc/class.bofilemanager.inc.php

    r5509 r5912  
    227227                                } 
    228228                        } 
    229                         elseif ($this->hostname != "" && ereg('^'.$this->hostname, $string)) 
     229                        elseif ($this->hostname != "" && preg_match('/^/'.$this->hostname, $string)) 
    230230//                      elseif (ereg ('^'.$this->hostname, $string)) 
    231231                        { 
  • trunk/filemanager/inc/class.vfs_functions.inc.php

    r5509 r5912  
    436436                                        $_return[] = array( "error" => $badchar);        
    437437                                } 
    438                                 if(ereg("/", $this->to) || ereg("\\\\", $this->to)) 
     438                                if(preg_match('/\//', $this->to) || preg_match('/\\\\/', $this->to)) 
    439439                                { 
    440440                                        $_return[] = array( "error"=> "slashes"); 
  • trunk/listAdmin/docs/manageheader.php

    r3514 r5912  
    3030         */ 
    3131        $realpath = realpath('..'); 
    32         if(!ereg('^' . $_SERVER['DOCUMENT_ROOT'],$realpath)) 
     32        if(!preg_match('/^/' . $_SERVER['DOCUMENT_ROOT'],$realpath)) 
    3333        { 
    3434                if(PHP_OS == 'Windows') 
  • trunk/listAdmin/inc/sieve-php.lib.php

    r3514 r5912  
    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 
     
    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 
  • trunk/mobile/inc/class.ui_preferences.inc.php

    r4277 r5912  
    5858                        foreach($vars as $name => $value) 
    5959                        { 
    60                                 if (ereg('^lang_', $name) !== false) 
     60                                if (preg_match('/^lang_/', $name) !== false) 
    6161                                { 
    6262                                        $GLOBALS['phpgw']->template->set_var($name, lang(str_replace('_',' ',substr($name, 5)))); 
  • trunk/phpgwapi/inc/class.clientsniffer.inc.php

    r2 r5912  
    237237                                $this->OS = 'hpux'; 
    238238                        } 
    239                         if(eregi('hp-ux',$this->UA) && ereg('10.',$this-UA))   
     239                        if(eregi('hp-ux',$this->UA) && preg_match('/10./',$this-UA))   
    240240                        { 
    241241                                $this->PLATFORM = 'Unix'; 
    242242                                $this->OS = 'hpux10'; 
    243243                        } 
    244                         elseif(eregi('hp-ux',$this->UA) && ereg('09.',$this-UA))   
     244                        elseif(eregi('hp-ux',$this->UA) && preg_match('/09./',$this-UA))   
    245245                        { 
    246246                                $this->PLATFORM = 'Unix'; 
  • trunk/phpgwapi/inc/class.common.inc.php

    r5141 r5912  
    5858                function cmp_version($str1,$str2,$debug=False) 
    5959                { 
    60                         ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)",$str1,$regs); 
    61                         ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)",$str2,$regs2); 
     60                        preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)/',$str1,$regs); 
     61                        preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)/',$str2,$regs2); 
    6262                        if($debug) { echo "<br>$regs[0] - $regs2[0]"; } 
    6363 
     
    8989                function cmp_version_long($str1,$str2,$debug=False) 
    9090                { 
    91                         ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)",$str1,$regs); 
    92                         ereg("([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)",$str2,$regs2); 
     91                        preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)/',$str1,$regs); 
     92                        preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)[a-zA-Z]*([0-9]*)\.([0-9]*)/',$str2,$regs2); 
    9393                        if($debug) { echo "<br>$regs[0] - $regs2[0]"; } 
    9494 
     
    456456                        /* 
    457457                        $s = '<a href="' . $GLOBALS['phpgw']->link($link,$extravars) . '"> ' . lang($label) . ' </a>'; 
    458                         if (ereg('^[0-9]+$',$record)) 
     458                        if (preg_match('/^[0-9]+$/',$record)) 
    459459                        { 
    460460                                if ($record != $GLOBALS['phpgw_info']['user']['account_id']) 
  • trunk/phpgwapi/inc/class.graphics.inc.php

    r2 r5912  
    8787                                while( list($key, $val) = each($HTTP_POST_VARS))  
    8888                                { 
    89                                         if (ereg("(.*)_x",$key,$varName) && $HTTP_POST_VARS[$varName[1]."_y"]) 
     89                                        if (preg_match('/(.*)_x/',$key,$varName) && $HTTP_POST_VARS[$varName[1]."_y"]) 
    9090                                        { 
    9191                                                $name = $varName[1]; 
  • trunk/phpgwapi/inc/class.http.inc.php

    r2 r5912  
    459459                                                                        break; 
    460460                                                                case 'expires': 
    461                                                                         if(ereg("^((Mon|Monday|Tue|Tuesday|Wed|Wednesday|Thu|Thursday|Fri|Friday|Sat|Saturday|Sun|Sunday), )?([0-9]{2})\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-([0-9]{2,4}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2}) GMT$",$value,$matches)) 
     461                                                                        if(preg_match('/^((Mon|Monday|Tue|Tuesday|Wed|Wednesday|Thu|Thursday|Fri|Friday|Sat|Saturday|Sun|Sunday), )?([0-9]{2})\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-([0-9]{2,4}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2}) GMT$/',$value,$matches)) 
    462462                                                                        { 
    463463                                                                                $year = (int)$matches[5]; 
  • trunk/phpgwapi/inc/class.http_dav_client.inc.php

    r2 r5912  
    151151                        foreach ($attr as $name => $value) 
    152152                        { 
    153                                 if (ereg('^XMLNS:(.*)', $name, $matches) ) 
     153                                if (preg_match('/^XMLNS:(.*)/', $name, $matches) ) 
    154154                                { 
    155155                                        $this->namespaces[$matches[1]] = $value; 
  • trunk/phpgwapi/inc/class.network.inc.php

    r2 r5912  
    164164                        } 
    165165                        $response = $this->read_port(); 
    166                         if(!ereg(strtoupper($expected_response),strtoupper($response))) 
     166                        if(!preg_match('/'.strtoupper($expected_response).'/',strtoupper($response))) 
    167167                        { 
    168168                                if(substr($expected_response,1,1) == '+') 
  • trunk/phpgwapi/inc/class.sbox.inc.php

    r588 r5912  
    276276                        ); 
    277277 
    278                         if (ereg(",", $selected)) 
     278                        if (preg_match('/,/', $selected)) 
    279279                        { 
    280280                                $selected = "group"; 
     
    313313                                        } 
    314314                                } 
    315                                 elseif (ereg("," . $group['account_id'] . ",", $selected)) 
     315                                elseif (preg_match('/,/' . $group['account_id'] . ",", $selected)) 
    316316                                { 
    317317                                        $out .= " SELECTED"; 
  • trunk/phpgwapi/inc/class.soap_client.inc.php

    r2 r5912  
    5353 
    5454                        // endpoint mangling 
    55                         if(ereg("^http://",$path)) 
     55                        if(preg_match('/^http:\/\//',$path)) 
    5656                        { 
    5757                                $path = str_replace('http://','',$path); 
    5858                                $this->path = strstr($path,'/'); 
    5959                                $this->debug("path = $this->path"); 
    60                                 if(ereg(':',$path)) 
     60                                if(preg_match('/:/',$path)) 
    6161                                { 
    6262                                        $this->server = substr($path,0,strpos($path,':')); 
  • trunk/phpgwapi/inc/class.soap_parser.inc.php

    r5509 r5912  
    143143 
    144144                        // set status 
    145                         if(ereg(":Envelope$",$name)) 
     145                        if(preg_match('/:Envelope$/',$name)) 
    146146                        { 
    147147                                $this->status = 'envelope'; 
    148148                        } 
    149                         elseif(ereg(":Header$",$name)) 
     149                        elseif(preg_match('/:Header$/',$name)) 
    150150                        { 
    151151                                $this->status = 'header'; 
    152152                        } 
    153                         elseif(ereg(":Body$",$name)) 
     153                        elseif(preg_match('/:Body$/',$name)) 
    154154                        { 
    155155                                $this->status = 'body'; 
     
    159159                        { 
    160160                                $this->status = 'method'; 
    161                                 if(ereg(':',$name)) 
     161                                if(preg_match('/:/',$name)) 
    162162                                { 
    163163                                        $this->root_struct_name = substr(strrchr($name,':'),1); 
     
    178178                        $this->message[$pos]['attrs'] = $attrs; 
    179179                        // get namespace 
    180                         if(ereg(":",$name)) 
     180                        if(preg_match('/:/',$name)) 
    181181                        { 
    182182                                $namespace = substr($name,0,strpos($name,':')); 
     
    194194                        { 
    195195                                // if ns declarations, add to class level array of valid namespaces 
    196                                 if(ereg('xmlns:',$key)) 
     196                                if(preg_match('/xmlns:/',$key)) 
    197197                                { 
    198198                                        $namespaces[substr(strrchr($key,':'),1)] = $value; 
     
    289289                                $this->status = 'body'; 
    290290                        } 
    291                         elseif(ereg(':Body',$name)) 
     291                        elseif(preg_match('/:Body/',$name)) 
    292292                        { 
    293293                                $this->status = 'header'; 
    294294                        } 
    295                         elseif(ereg(':Header',$name)) 
     295                        elseif(preg_match('/:Header/',$name)) 
    296296                        { 
    297297                                $this->status = 'envelope'; 
  • trunk/phpgwapi/inc/class.soap_server.inc.php

    r5509 r5912  
    9292                        { 
    9393                                $action = str_replace('"','',$headers_array["SOAPAction"]); 
    94                                 if(ereg("^urn:",$action)) 
     94                                if(preg_match('/^urn:/',$action)) 
    9595                                { 
    9696                                        $this->service = substr($action,4); 
    9797                                } 
    98                                 elseif(ereg(".php",$action)) 
     98                                elseif(preg_match('/.php/',$action)) 
    9999                                { 
    100100                                        $this->service = ereg_replace('"|/','',substr(strrchr($action,".php"),4,strlen(strrchr($action,"/")))); 
     
    126126                                /* egroupware customization - createobject based on methodname */ 
    127127                                list($app,$class,$method) = explode('.',$this->methodname); 
    128                                 if(ereg("^service",$app)) 
     128                                if(preg_match('/^service/',$app)) 
    129129                                { 
    130130                                        $args  = $class; 
  • trunk/phpgwapi/inc/class.soapmsg.inc.php

    r5509 r5912  
    122122                        // strip headers here 
    123123                        //$clean_data = ereg_replace("\r\n","\n", $data); 
    124                         if(ereg("^.*\r\n\r\n<",$data)) 
     124                        if(preg_match('/^.*\r\n\r\n</',$data)) 
    125125                        { 
    126126                                $this->debug("found proper seperation of headers and document"); 
     
    144144        /* 
    145145                        // if response is a proper http response, and is not a 200 
    146                         if(ereg("^HTTP",$clean_data) && !ereg("200$", $clean_data)) 
     146                        if(preg_match('/^HTTP/',$clean_data) && !ereg("200$", $clean_data)) 
    147147                        { 
    148148                                // get error data 
  • trunk/phpgwapi/inc/class.soapval.inc.php

    r5509 r5912  
    5454                                if(is_array($value) && count($value) >= 1) 
    5555                                { 
    56                                         if(ereg("[a-zA-Z0-9\-]*",key($v))) 
     56                                        if(preg_match('/[a-zA-Z0-9\-]*/',key($v))) 
    5757                                        { 
    5858                                                $type = 'struct'; 
     
    104104 
    105105                        // get type prefix 
    106                         if(ereg(":",$type)) 
     106                        if(preg_match('/:/',$type)) 
    107107                        { 
    108108                                $this->type = substr(strrchr($type,':'),1,strlen(strrchr($type,':'))); 
     
    199199                                                if(is_array($v)) 
    200200                                                { 
    201                                                         if(ereg("[a-zA-Z\-]*",key($v))) 
     201                                                        if(preg_match('/[a-zA-Z\-]*/',key($v))) 
    202202                                                        { 
    203203                                                                $type = 'struct'; 
     
    208208                                                        } 
    209209                                                } 
    210                                                 elseif(!ereg("^[0-9]*$",$k) && in_array($k,array_keys($this->soapTypes))) 
     210                                                elseif(!preg_match('/^[0-9]*$/',$k) && in_array($k,array_keys($this->soapTypes))) 
    211211                                                { 
    212212                                                        $type = $k; 
  • trunk/phpgwapi/inc/class.vfs_dav.inc.php

    r3863 r5912  
    22792279                                ); 
    22802280                        } 
    2281                         elseif (preg_match ("+^$this->fakebase\/(.*)$+U", $p->fake_full_path, $matches)) 
     2281                        elseif (ereg("+^$this->fakebase\/(.*)$+U", $p->fake_full_path, $matches)) 
    22822282                        { 
    22832283                                $set_attributes_array = Array( 
     
    23722372                        for($i=0;$i<sizeof($contents);$i++) 
    23732373                        { 
    2374                                 if (!ereg("^#",$contents[$i])) 
     2374                                if (!preg_match('/^#/',$contents[$i])) 
    23752375                                { 
    23762376                                        $line=split("[[:space:]]+", $contents[$i]); 
     
    25942594                        ); 
    25952595                 
    2596                         if ($data['checksubdirs']==False && ereg('.*/$', $data['string']) && $data['nofiles'] ) 
     2596                        if ($data['checksubdirs']==False && preg_match('/.*\/$/', $data['string']) && $data['nofiles'] ) 
    25972597                        { 
    25982598$this->debug('Returning empty for'.$data['string']); 
  • trunk/phpgwapi/inc/class.vfs_shared.inc.php

    r5164 r5912  
    795795                        for($i=0;$i<sizeof($contents);$i++) 
    796796                        { 
    797                                 if (!ereg("^#",$contents[$i])) 
     797                                if (!preg_match('/^#/',$contents[$i])) 
    798798                                { 
    799799                                        $line=split("[[:space:]]+", $contents[$i]); 
  • trunk/phpgwapi/inc/class.wsdl.inc.php

    r5509 r5912  
    215215                        } 
    216216                        // get element prefix 
    217                         if(ereg(":",$name)) 
     217                        if(preg_match('/:/',$name)) 
    218218                        { 
    219219                                $prefix = substr($name,0,strpos($name,':')); 
  • trunk/phpgwapi/inc/class.xml.inc.php

    r5509 r5912  
    504504    { 
    505505        // Check whether the node is an attribute node. 
    506         if ( ereg("/attribute::", $node) ) 
     506        if ( preg_match('/\/attribute::/', $node) ) 
    507507        { 
    508508            // Get the path to the attribute node's parent. 
     
    622622    { 
    623623        // Check whether it's an attribute node. 
    624         if ( ereg("/attribute::", $path) ) 
     624        if ( preg_match('/\/attribute::/', $path) ) 
    625625        { 
    626626            // Get the path to the attribute node's parent. 
     
    659659    { 
    660660        // Check whether it's an attribute node. 
    661         if ( ereg("/attribute::", $path) ) 
     661        if ( preg_match('/\/attribute::/', $path) ) 
    662662        { 
    663663            // Get the path to the attribute node's parent. 
     
    698698    { 
    699699        // Check whether it's an attribute node. 
    700         if ( ereg("/attribute::", $path) ) 
     700        if ( preg_match('/\/attribute::/', $path) ) 
    701701        { 
    702702            // Get the path to the attribute node's parent. 
     
    10631063         
    10641064        // Check whether there are predicates. 
    1065         if ( ereg("\[", $step) ) 
     1065        if ( preg_match('/\[/', $step) ) 
    10661066        { 
    10671067            // Get the predicates. 
     
    11091109                $axis["node-test"] = "*"; 
    11101110            } 
    1111             elseif ( ereg("\(", $step) ) 
     1111            elseif ( preg_match('/\(/', $step) ) 
    11121112            { 
    11131113                // Check whether it's a function. 
     
    11641164                $axis["node-test"] = "*"; 
    11651165            } 
    1166             elseif ( ereg("^[a-zA-Z0-9\-_]+$", $step) ) 
     1166            elseif ( preg_match('/^[a-zA-Z0-9\-_]+$/', $step) ) 
    11671167            { 
    11681168                // Select the child axis and the child. 
     
    15061506            { 
    15071507                // Check whether there's a - sign in the function name. 
    1508                 if ( ereg("-", $function) ) 
     1508                if ( preg_match('/-/', $function) ) 
    15091509                { 
    15101510                    // Get the position of the - in the function name. 
     
    16251625         
    16261626        // Check whether the predicate is a function. 
    1627         if ( ereg("\(", $predicate) ) 
     1627        if ( preg_match('/\(/', $predicate) ) 
    16281628        { 
    16291629            // Get the position of the first bracket. 
     
    16741674         
    16751675        // Check whether the predicate is just a digit. 
    1676         if ( ereg("^[0-9]+(\.[0-9]+)?$", $predicate) || 
    1677             ereg("^\.[0-9]+$", $predicate) ) 
     1676        if ( preg_match('/^[0-9]+(\.[0-9]+)?$/', $predicate) || 
     1677            preg_match('/^\.[0-9]+$/', $predicate) ) 
    16781678        { 
    16791679            // Return the value of the digit. 
     
    17281728            { 
    17291729                // Check whether the predicate is just an number. 
    1730                 if ( ereg("^[0-9]+$", $predicate) ) 
     1730                if ( preg_match('/^[0-9]+$/', $predicate) ) 
    17311731                { 
    17321732                    // Enhance the predicate. 
     
    17961796    { 
    17971797        // Check whether it's a function. 
    1798         if ( ereg("\(", $node_test) ) 
     1798        if ( preg_match('/\(/', $node_test) ) 
    17991799        { 
    18001800            // Get the type of function to use. 
     
    18721872            return true; 
    18731873        } 
    1874         elseif ( ereg("^[a-zA-Z0-9\-_]+", $node_test) ) 
     1874        elseif ( preg_match('/^[a-zA-Z0-9\-_]+/', $node_test) ) 
    18751875        { 
    18761876            // Check whether the node-test can be fulfilled. 
     
    26022602    { 
    26032603        // Check what type of parameter is given 
    2604         if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) || 
    2605             ereg("^\.[0-9]+$", $arguments) ) 
     2604        if ( preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) || 
     2605            preg_match('/^\.[0-9]+$/', $arguments) ) 
    26062606        { 
    26072607            // Convert the digits to a number. 
     
    27112711             
    27122712        // Check whether the first string starts with the second one. 
    2713         if ( ereg("^".$second, $first) ) 
     2713        if ( preg_match('/^/'.$second, $first) ) 
    27142714        { 
    27152715            // Return true. 
     
    27492749             
    27502750        // Check whether the first string starts with the second one. 
    2751         if ( ereg($second, $first) ) 
     2751        if ( preg_match('/'.$second.'/', $first) ) 
    27522752        { 
    27532753            // Return true. 
     
    29452945         
    29462946        // Check what type of parameter is given 
    2947         if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) || 
    2948             ereg("^\.[0-9]+$", $arguments) ) 
     2947        if ( preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) || 
     2948            preg_match('/^\.[0-9]+$/', $arguments) ) 
    29492949        { 
    29502950            // Convert the digits to a number. 
     
    31383138    { 
    31393139        // Check the type of argument. 
    3140         if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) || 
    3141             ereg("^\.[0-9]+$", $arguments) ) 
     3140        if ( preg_match('/^[0-9]+(\.[0-9]+)?$/', $arguments) || 
     3141            preg_match('/^\.[0-9]+$/', $arguments) ) 
    31423142        { 
    31433143            // Return the argument as a number. 
  • trunk/phpgwapi/inc/class.xmlrpc_server_epi.inc.php

    r2 r5912  
    163163 
    164164                        /* Setup dispatch map based on the function, if this is a system call */ 
    165                         if(ereg('^system\.', $methName)) 
     165                        if(preg_match('/^system\./', $methName)) 
    166166                        { 
    167167                                foreach($GLOBALS['_xmlrpcs_dmap'] as $meth => $dat) 
     
    172172                                $dmap = $this->dmap; 
    173173                        } 
    174                         elseif(ereg('^examples\.',$methName) || 
    175                                 ereg('^validator1\.',$methName) || 
    176                                 ereg('^interopEchoTests\.', $methName) 
     174                        elseif(preg_match('/^examples\./',$methName) || 
     175                                preg_match('/^validator1\./',$methName) || 
     176                                preg_match('/^interopEchoTests\./', $methName) 
    177177                        ) 
    178178                        { 
  • trunk/phpgwapi/inc/class.xmlrpc_server_php.inc.php

    r5509 r5912  
    247247                        $_type = (is_integer($_res) ? 'int' : gettype($_res)); 
    248248 
    249                         if ($_type == 'string' && (ereg('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res) 
    250                                                    || ereg('^[0-9]{4}[0-9]{2}[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res) ) ) 
     249                        if ($_type == 'string' && (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/',$_res) 
     250                                                   || preg_match('/^[0-9]{4}[0-9]{2}[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/',$_res) ) ) 
    251251                        { 
    252252                                $_type = 'dateTime.iso8601'; 
     
    316316                                $this->last_method = $methName; 
    317317 
    318                                 if (ereg("^system\.", $methName)) 
     318                                if (preg_match('/^system\./', $methName)) 
    319319                                { 
    320320                                        $dmap = $GLOBALS['_xmlrpcs_dmap']; 
     
    350350                                                $class    = $tmp[0]; 
    351351 
    352                                                 if (ereg('^service',$method)) 
     352                                                if (preg_match('/^service/',$method)) 
    353353                                                { 
    354354                                                        $t = 'phpgwapi.' . $class . '.exec'; 
     
    418418                                                                $this->req_array = $GLOBALS['phpgw']->translation->convert($this->req_array,'utf-8'); 
    419419                                                                //_debug_array($this->req_array); 
    420                                                                 if (ereg('^service',$method)) 
     420                                                                if (preg_match('/^service/',$method)) 
    421421                                                                { 
    422422                                                                        $res = ExecMethod('phpgwapi.service.exec',array($service,$methName,$this->req_array)); 
  • trunk/phpgwapi/inc/class.xmlrpcmsg.inc.php

    r5509 r5912  
    157157                        // see if we got an HTTP 200 OK, else bomb 
    158158                        // but only do this if we're using the HTTP protocol. 
    159                         if (ereg("^HTTP",$data) && !ereg("^HTTP/[0-9.]+ 200 ", $data)) 
     159                        if (preg_match('/^HTTP/',$data) && !preg_match('/^HTTP/[0-9.]+ 200 /', $data)) 
    160160                        { 
    161161                                $errstr = substr($data, 0, strpos($data, "\n")-1); 
     
    169169                        // if using HTTP, then gotta get rid of HTTP headers here 
    170170                        // and we store them in the 'ha' bit of our data array 
    171                         if (ereg("^HTTP", $data)) 
     171                        if (preg_match('/^HTTP/', $data)) 
    172172                        { 
    173173                                $ar=explode("\r\n", $data); 
  • trunk/phpgwapi/inc/xml_functions.inc.php

    r5509 r5912  
    151151                while($i<sizeof($top)) 
    152152                { 
    153                         if (ereg("^([#a-zA-Z0-9]+);", $top[$i], $regs)) 
     153                        if (preg_match('/^([#a-zA-Z0-9]+);/', $top[$i], $regs)) 
    154154                        { 
    155155                                $op .= ereg_replace("^[#a-zA-Z0-9]+;", 
     
    178178                        return $GLOBALS['xmlEntities'][strtolower($ent)]; 
    179179                } 
    180                 if (ereg("^#([0-9]+)$", $ent, $regs)) 
     180                if (preg_match('/^#([0-9]+)$/', $ent, $regs)) 
    181181                { 
    182182                        return chr($regs[1]); 
     
    313313                                        // we have an I4, INT or a DOUBLE 
    314314                                        // we must check that only 0123456789-.<space> are characters here 
    315                                         if (!ereg("^\-?[0123456789 \t\.]+$", $GLOBALS['_xh'][$parser]['ac'])) 
     315                                        if (!preg_match('/^\-?[0123456789 \t\.]+$/', $GLOBALS['_xh'][$parser]['ac'])) 
    316316                                        { 
    317317                                                // TODO: find a better way of throwing an error 
     
    387387        function xmlrpc_cd($parser, $data) 
    388388        { 
    389                 //if (ereg("^[\n\r \t]+$", $data)) return; 
     389                //if (preg_match('/^[\n\r \t]+$/', $data)) return; 
    390390                // print "adding [${data}]\n"; 
    391391 
     
    460460                // return a timet in the localtime, or UTC 
    461461                $t=0; 
    462                 if (ereg("([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})",$idate, $regs)) 
     462                if (preg_match('/([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})/',$idate, $regs)) 
    463463                { 
    464464                        if ($utc) 
     
    590590                $methName = $m->getParam(0); 
    591591                $methName = $methName->scalarval(); 
    592                 if (ereg("^system\.", $methName)) 
     592                if (preg_match('/^system\./', $methName)) 
    593593                { 
    594594                        $dmap = $GLOBALS['_xmlrpcs_dmap']; 
     
    637637                $methName = $m->getParam(0); 
    638638                $methName = $methName->scalarval(); 
    639                 if (ereg("^system\.", $methName)) 
     639                if (preg_match('/^system\./', $methName)) 
    640640                { 
    641641                        $dmap = $GLOBALS['_xmlrpcs_dmap']; 
  • trunk/phpgwapi/templates/classic/login_classic.php

    r3243 r5912  
    294294        foreach($_GET as $name => $value) 
    295295        { 
    296                 if(ereg('phpgw_',$name)) 
     296                if(preg_match('/phpgw_/',$name)) 
    297297                { 
    298298                        $extra_vars .= '&' . $name . '=' . urlencode($value); 
Note: See TracChangeset for help on using the changeset viewer.