Changeset 5921 for trunk/workflow


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/workflow/inc
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/workflow/inc/class.BrowserInfo.inc.php

    r795 r5921  
    115115                        $bd['version'] = "1.0"; 
    116116                        $var = stristr($agent, "/"); 
    117                         if (ereg("308|425|426|474|0b1", $var)) 
     117                        if (preg_match('/308|425|426|474|0b1/', $var)) 
    118118                                $bd['version'] = "1.5"; 
    119119 
  • trunk/workflow/inc/class.basemodel.inc.php

    r3167 r5921  
    127127                foreach ($attributes as $attribute => $value) { 
    128128                        /* parses only process-level attributes, whose names start with a _ signal */ 
    129                         if (ereg('^_{1}', $attribute)) { 
     129                        if (preg_match('/^_{1}/', $attribute)) { 
    130130                                $result[$attribute] = $this->{$attribute}; 
    131131                        } 
  • trunk/workflow/inc/class.bo_monitors.inc.php

    r3167 r5921  
    12481248                { 
    12491249                        /* split the e-mail according to definition */ 
    1250                         ereg('(.*)%inicio_loop%(.*)%fim_loop%(.*)', $emailBody, $records); 
     1250                        preg_match('/(.*)%inicio_loop%(.*)%fim_loop%(.*)/', $emailBody, $records); 
    12511251                        if (($records == null) || (count($records) != 4)) 
    12521252                                return array('error' => 'Formato de e-mail inválido'); 
  • trunk/workflow/inc/class.bo_orgchart.inc.php

    r3167 r5921  
    464464        function searchEmployee($params) 
    465465        { 
    466                 if (!ereg('^([[:alnum:] ]+)$', $params['search_term'])) 
     466                if (!preg_match('/^([[:alnum:] ]+)$/', $params['search_term'])) 
    467467                        die(serialize("Parametro de busca inválido")); 
    468468                $result = $this->so->searchEmployee($params['search_term'], $params['organizacao_id']); 
  • trunk/workflow/inc/class.bo_userinterface.inc.php

    r3167 r5921  
    920920        function searchEmployee($params) 
    921921        { 
    922                 if (!ereg('^([[:alnum:] -]+)$', $params['searchTerm'])) 
     922                if (!preg_match('/^([[:alnum:] -]+)$/', $params['searchTerm'])) 
    923923                        return array('error' => 'Parâmetro de busca inválido'); 
    924924 
  • trunk/workflow/inc/class.powergraphic.inc.php

    r3167 r5921  
    298298        $this->latin_notation = ((isset($_GET['latin_notation'])) && ($_GET['latin_notation'] == 1)) ? true : false; 
    299299 
    300         $this->legend_exists        = (ereg("(5|6)", $this->type)) ? true : false; 
     300        $this->legend_exists        = (preg_match('/(5|6)/', $this->type)) ? true : false; 
    301301        $this->biggest_graphic_name = (strlen($this->graphic_1) > strlen($this->graphic_2)) ? $this->graphic_1 : $this->graphic_2; 
    302302        $this->height_title         = (!empty($this->title)) ? ($this->string_height(5) + 15) : 0; 
     
    367367                    $temp[$num] = $value; 
    368368 
    369                     if ((!empty($_GET['z'.$num])) && (ereg("(1|2|3|4)", $this->type))) 
     369                    if ((!empty($_GET['z'.$num])) && (preg_match('/(1|2|3|4)/', $this->type))) 
    370370                    { 
    371371                        $this->graphic_2_exists = true; 
     
    449449 
    450450        // Draw axis and background lines for "vertical bars", "dots" and "lines" 
    451         if (ereg("^(1|3|4)$", $this->type)) 
     451        if (preg_match('/^(1|3|4)$/', $this->type)) 
    452452        { 
    453453            if ($this->legend_exists == true) 
     
    525525 
    526526        // Draw legend box for "pie" or "donut" 
    527         else if (ereg("^(5|6)$", $this->type)) 
     527        else if (preg_match('/^(5|6)$/', $this->type)) 
    528528        { 
    529529            $this->draw_legend(); 
     
    615615        * Draw graphic: DOTS or LINE 
    616616        */ 
    617         else if (ereg("^(3|4)$", $this->type)) 
     617        else if (preg_match('/^(3|4)$/', $this->type)) 
    618618        { 
    619619 
     
    680680        * Draw graphic: PIE or DONUT 
    681681        */ 
    682         else if (ereg("^(5|6)$", $this->type)) 
     682        else if (preg_match('/^(5|6)$/', $this->type)) 
    683683        { 
    684684            $center_x = ($this->graphic_area_x1 + $this->graphic_area_x2) / 2; 
     
    909909 
    910910        // Draw legend values for VERTICAL BARS, HORIZONTAL BARS, DOTS and LINES 
    911         if (ereg("^(1|2|3|4)$", $this->type)) 
    912         { 
    913             $color_1 = (ereg("^(1|2)$", $this->type)) ? $this->color['bars']   : $this->color['line']; 
    914             $color_2 = (ereg("^(1|2)$", $this->type)) ? $this->color['bars_2'] : $this->color['line_2']; 
     911        if (preg_match('/^(1|2|3|4)$/', $this->type)) 
     912        { 
     913            $color_1 = (preg_match('/^(1|2)$/', $this->type)) ? $this->color['bars']   : $this->color['line']; 
     914            $color_2 = (preg_match('/^(1|2)$/', $this->type)) ? $this->color['bars_2'] : $this->color['line_2']; 
    915915 
    916916            imagefilledrectangle($this->img, $x, $y, ($x+10), ($y+10), $color_1); 
     
    924924 
    925925        // Draw legend values for PIE or DONUT 
    926         else if (ereg("^(5|6)$", $this->type)) 
     926        else if (preg_match('/^(5|6)$/', $this->type)) 
    927927        { 
    928928            if (!empty($this->axis_x)) 
     
    10501050                $this->color['bg_legend']   = imagecolorallocate($this->img, 205, 205, 205); 
    10511051 
    1052                 if (ereg("^(1|2)$", $this->type)) 
     1052                if (preg_match('/^(1|2)$/', $this->type)) 
    10531053                { 
    10541054                    $this->color['bars']          = imagecolorallocate($this->img, 100, 150, 200); 
     
    10571057                    $this->color['bars_2_shadow'] = imagecolorallocate($this->img, 120, 170,  70); 
    10581058                } 
    1059                 else if (ereg("^(3|4)$", $this->type)) 
     1059                else if (preg_match('/^(3|4)$/', $this->type)) 
    10601060                { 
    10611061                    $this->color['line']   = imagecolorallocate($this->img, 100, 150, 200); 
    10621062                    $this->color['line_2'] = imagecolorallocate($this->img, 230, 100, 100); 
    10631063                } 
    1064                 else if (ereg("^(5|6)$", $this->type)) 
     1064                else if (preg_match('/^(5|6)$/', $this->type)) 
    10651065                { 
    10661066                    $this->color['arc_1']        = imagecolorallocate($this->img, 100, 150, 200); 
     
    10901090                $this->color['bg_legend']   = imagecolorallocate($this->img,  70,  70,  70); 
    10911091 
    1092                 if (ereg("^(1|2)$", $this->type)) 
     1092                if (preg_match('/^(1|2)$/', $this->type)) 
    10931093                { 
    10941094                    $this->color['bars']          = imagecolorallocate($this->img,  50, 200,  50); 
     
    10971097                    $this->color['bars_2_shadow'] = imagecolorallocate($this->img, 220, 220, 220); 
    10981098                } 
    1099                 else if (ereg("^(3|4)$", $this->type)) 
     1099                else if (preg_match('/^(3|4)$/', $this->type)) 
    11001100                { 
    11011101                    $this->color['line']   = imagecolorallocate($this->img, 220, 220, 220); 
    11021102                    $this->color['line_2'] = imagecolorallocate($this->img,   0, 180,   0); 
    11031103                } 
    1104                 else if (ereg("^(5|6)$", $this->type)) 
     1104                else if (preg_match('/^(5|6)$/', $this->type)) 
    11051105                { 
    11061106                    $this->color['arc_1']        = imagecolorallocate($this->img, 255, 255, 255); 
     
    11311131                $this->color['bg_legend']   = imagecolorallocate($this->img, 230, 230, 200); 
    11321132 
    1133                 if (ereg("^(1|2)$", $this->type)) 
     1133                if (preg_match('/^(1|2)$/', $this->type)) 
    11341134                { 
    11351135                    $this->color['bars']          = imagecolorallocate($this->img, 255, 170,  80); 
     
    11381138                    $this->color['bars_2_shadow'] = imagecolorallocate($this->img, 180, 150,   0); 
    11391139                } 
    1140                 else if (ereg("^(3|4)$", $this->type)) 
     1140                else if (preg_match('/^(3|4)$/', $this->type)) 
    11411141                { 
    11421142                    $this->color['line']   = imagecolorallocate($this->img, 230, 100,   0); 
  • trunk/workflow/inc/class.utils.url.php

    r795 r5921  
    157157                        return NULL; 
    158158                }                        
    159                 if (ereg("[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}", $this->host)) { 
     159                if (preg_match('/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/', $this->host)) { 
    160160                        return gethostbyaddr($this->host); 
    161161                } else { 
     
    320320                        $url = $this->getUrl(); 
    321321                // busca a string de parametros 
    322                 if (ereg("([^?#]+\??)?([^#]+)?(.*)", $url, $matches)) {                  
     322                if (preg_match('/([^?#]+\??)?([^#]+)?(.*)/', $url, $matches)) {                  
    323323                        if (!$this->isFalse($matches[2])) { 
    324324                                // codifica os parametros 
     
    346346                        $url = $this->getUrl(); 
    347347                // busca os parï¿œmetros codificados             
    348                 ereg("([^?#]+\??)?([^#]+)?(.*)", $url, $matches); 
     348                preg_match('/([^?#]+\??)?([^#]+)?(.*)/', $url, $matches); 
    349349                if (!$this->isFalse($matches[2])) { 
    350350                        parse_str($matches[2], $vars); 
  • trunk/workflow/inc/engine/src/ProcessManager/ProcessManager.php

    r4740 r5921  
    480480                } 
    481481 
    482                 if (ereg('^[0-9]{1,2}\.[0-9]{1,2}$', $vars['wf_version']) === false) 
     482                if (preg_match('/^[0-9]{1,2}\.[0-9]{1,2}$/', $vars['wf_version']) === false) 
    483483                { 
    484484                        $msg = tra('invalid version specified'); 
  • trunk/workflow/inc/local/classes/class.wf_date.php

    r795 r5921  
    7676        function isEuroDate($date, &$regs) { 
    7777                $date = trim($date); 
    78                 if (ereg("^([0-9]{1,2})(/|\-|\.)([0-9]{1,2})(/|\-|\.)([0-9]{4})([[:space:]]([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?)?$", $date, $matches)) { 
     78                if (preg_match('/^([0-9]{1,2})(\/|\-|\.)([0-9]{1,2})(\/|\-|\.)([0-9]{4})([[:space:]]([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?)?$/', $date, $matches)) { 
    7979                        $regs = array( 
    8080                                $matches[0],  
     
    9696        function isUsDate($date, &$regs) { 
    9797                $date = trim($date); 
    98                 if (ereg("^([0-9]{4})(/|\-|\.)([0-9]{1,2})(/|\-|\.)([0-9]{1,2})([[:space:]]([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?)?$", $date, $matches)) { 
     98                if (preg_match('/^([0-9]{4})(\/|\-|\.)([0-9]{1,2})(\/|\-|\.)([0-9]{1,2})([[:space:]]([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?)?$/', $date, $matches)) { 
    9999                        $regs = array( 
    100100                                $matches[0],  
     
    116116        function isSqlDate($date, &$regs) { 
    117117                $date = trim($date); 
    118                 if (ereg("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})([[:space:]]([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?)?$", $date, $matches)) { 
     118                if (preg_match('/^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})([[:space:]]([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?)?$/', $date, $matches)) { 
    119119                        $regs = array( 
    120120                                $matches[0],  
  • trunk/workflow/inc/local/classes/class.wf_regex.php

    r795 r5921  
    523523        { 
    524524                if ( $caseSensitive ) 
    525                         return( ereg( $pattern, (string) $input ) ); 
     525                        return( preg_match("/$pattern/", (string) $input ) ); 
    526526                else 
    527527                        return( eregi( $pattern, (string) $input ) ); 
  • trunk/workflow/inc/local/functions/function.wf_handle_download.php

    r795 r5921  
    3535                        if (isset($fileResult['filename']) && isset($fileResult['content'])) 
    3636                        { 
    37                                         if (ereg('Opera(/| )([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) 
     37                                        if (preg_match('/Opera(\/| )([0-9].[0-9]{1,2})/', $_SERVER['HTTP_USER_AGENT'])) 
    3838                                        $UserBrowser = "Opera"; 
    39                                 elseif (ereg('MSIE ([0-9].[0-9]{1,2})', $_SERVER['HTTP_USER_AGENT'])) 
     39                                elseif (preg_match('/MSIE ([0-9].[0-9]{1,2})/', $_SERVER['HTTP_USER_AGENT'])) 
    4040                                        $UserBrowser = "IE"; 
    4141                                        else 
Note: See TracChangeset for help on using the changeset viewer.