Changeset 5921 for trunk/calendar


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

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

Location:
trunk/calendar/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.boicalendar.inc.php

    r5316 r5921  
    12781278 
    12791279                                $this->line = $this->line + 1; 
    1280                         while (ereg("^[[:space:]]", $ical_text[$this->line])) { 
     1280                        while (preg_match('/^[[:space:]]/', $ical_text[$this->line])) { 
    12811281                                $str .= substr(str_replace("\r\n", '', $ical_text[$this->line]), 1); 
    12821282                                        $this->line = $this->line + 1; 
     
    13921392        function parse_parameters(& $event, $majortype, $value) { 
    13931393                        //$this->debug ('value: '.$value); 
    1394                 if (!ereg('[\=\;]', $value)) { 
     1394                if (!preg_match('/[\=\;]/', $value)) { 
    13951395                        $return_value[] = Array ( 
    13961396                                        'param' => $majortype, 
     
    13991399                                $value = ''; 
    14001400                        } 
    1401                 elseif (ereg('(.*(\:\\\\)?.*):(.*)', $value, $temp)) { 
     1401                elseif (preg_match('/(.*(\:\\\\)?.*):(.*)/', $value, $temp)) { 
    14021402                                //$this->debug('Value : '._debug_array($temp,False)); 
    14031403                                //$this->debug('Param '.$majortype.' Value : '.$temp[3]); 
     
    14091409                                $value = str_replace(':MAILTO', '', $temp[1]); 
    14101410                                } 
    1411                         while (ereg('(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)', $value, $temp)) { 
     1411                        while (preg_match('/(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)/', $value, $temp)) { 
    14121412                                        //$this->debug('Value : '._debug_array($temp,False)); 
    14131413                                        //$this->debug('Param '.$temp[2].' Value : '.$temp[3]); 
     
    14201420                                } 
    14211421                } else { 
    1422                         while (ereg('(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)', $value, $temp)) { 
     1422                        while (preg_match('/(([A-Z\-]*)[=]([[:alnum:] \_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&\@\<\>\-]*))([\;]?)(.*)/', $value, $temp)) { 
    14231423                                $this->debug('Value : ' . _debug_array($temp, False)); 
    14241424                                $this->debug('Param ' . $temp[2] . ' Value : ' . $temp[3]); 
     
    23472347                        //                              } 
    23482348 
    2349                         ereg($property_regexp, $text, $temp); 
     2349                        preg_match("/$property_regexp/", $text, $temp); 
    23502350                                //$this->debug ('Majortype dump: '._debug_array($temp, false) ); 
    23512351                        $majortype = str_replace('-', '_', strtolower($temp[1])); 
     
    23812381                                if (isset ($_f_['day_raw']) OR $_f_['day_raw']) { 
    23822382                                                // Days 
    2383                                         //                                              if(ereg('D', $_f_['day_raw'])) 
     2383                                        //                                              if(preg_match('/D/', $_f_['day_raw'])) 
    23842384                                        if (strstr($_f_['day_raw'], 'D')) { 
    23852385                                                        $dur['days'] = eregi_replace("([0-9]+)D(.*)", "\\1", $_f_['day_raw']); 
     
    23872387 
    23882388                                                // Weeks 
    2389                                         //                                              if(ereg("W", $_f_["day_raw"])) 
     2389                                        //                                              if(preg_match('/W/', $_f_["day_raw"])) 
    23902390                                        if (strstr($_f_['day_raw'], 'W')) { 
    23912391                                                        $dur['weeks'] = eregi_replace("([^|.*]+D)?([0-9]+)W", "\\2", $_f_['day_raw']); 
     
    23962396                                if (isset ($_f_['time_raw']) OR $_f_['time_raw']) { 
    23972397                                                // Hours 
    2398                                         //                                              if(ereg("H", $_f_["time_raw"])) 
     2398                                        //                                              if(preg_match('/H/', $_f_["time_raw"])) 
    23992399                                        if (strstr($_f_['time_raw'], 'H')) { 
    24002400                                                        $dur['hours'] = eregi_replace("([0-9]+)H(.*)", "\\1", $_f_['time_raw']); 
     
    24032403                                                // Minutes 
    24042404                                                /* If you find better, contact me very quickly :) */ 
    2405                                         //                                              if(ereg("M", $_f_["time_raw"])) 
     2405                                        //                                              if(preg_match('/M/', $_f_["time_raw"])) 
    24062406                                        if (strstr($_f_['time_raw'], 'M')) { 
    24072407                                                        $dur['minutes'] = eregi_replace("([^|.*]+H)?([0-9]+)M(.*)", "\\2", $_f_['time_raw']); 
     
    24102410                                                // Seconds 
    24112411                                                /* Same comment :) */ 
    2412                                         //                                              if(ereg("S", $_f_["time_raw"]) ) 
     2412                                        //                                              if(preg_match('/S/', $_f_["time_raw"]) ) 
    24132413                                        if (strstr($_f_['time_raw'], 'S')) { 
    24142414                                                        $dur['seconds'] = eregi_replace("([^|.*]+M)?([0-9]+)S(.*)", "\\2", $_f_['time_raw']); 
  • trunk/calendar/inc/class.uicalendar.inc.php

    r5316 r5921  
    45934593                        foreach($vars['participants']['data'] as $user => $str) 
    45944594                        { 
    4595                         if ($this->bo->check_perms(PHPGW_ACL_EDIT,0,$user) && ereg('^(.*) \((.*)\)$',$str,$parts)) 
     4595                        if ($this->bo->check_perms(PHPGW_ACL_EDIT,0,$user) && preg_match('/^(.*) \((.*)\)$/',$str,$parts)) 
    45964596                                { 
    45974597                                        $vars['participants']['data'][$user] = $parts[1].' (<a href="'.$this->page('edit_status','&cal_id='.$event['id'].'&owner='.$user).'">'.$parts[2].'</a>)'; 
Note: See TracChangeset for help on using the changeset viewer.