Changeset 5940


Ignore:
Timestamp:
04/13/12 10:19:53 (12 years ago)
Author:
marcosw
Message:

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

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/filemanager/inc/class.bofilemanager.inc.php

    r5912 r5940  
    227227                                } 
    228228                        } 
    229                         elseif ($this->hostname != "" && preg_match('/^/'.$this->hostname, $string)) 
     229                        elseif ($this->hostname != "" && preg_match("/^$this->hostname/", $string)) 
    230230//                      elseif (ereg ('^'.$this->hostname, $string)) 
    231231                        { 
    232                                 $rstring = ereg_replace ('^'.$this->hostname.'/', '', $string); 
    233                                 $rstring = preg_replace ("/(.*)(\/|$)/Ue", "rawurlencode (base64_encode ('\\1')) . '\\2'", $rstring); 
     232                                $rstring = preg_replace("/^$this->hostname\//", '', $string); 
     233                                $rstring = preg_replace("/(.*)(\/|$)/Ue", "rawurlencode (base64_encode ('\\1')) . '\\2'", $rstring); 
    234234                                $rstring = $this->hostname.'/'.$rstring; 
    235235                        } 
  • trunk/phpgwapi/inc/class.vfs_dav.inc.php

    r5921 r5940  
    319319                        ); 
    320320 
    321                         return (ereg_replace ('^\.+', '', $p->fake_name)); 
     321                        return (preg_replace('/^\.+/', '', $p->fake_name)); 
    322322                } 
    323323 
     
    360360                        } 
    361361 
    362                         $string = ereg_replace ("'", "\'", $data['string']); 
     362                        $string = preg_replace("/'/", "\'", $data['string']); 
    363363 
    364364                        return $string; 
     
    587587                                        if (preg_match("/^$link_info[directory]\/$link_info[name](\/|$)/", $rarray['fake_full_path'])) 
    588588                                        { 
    589                                                 $rarray['real_full_path'] = ereg_replace ("^$this->basedir", '', $rarray['real_full_path']); 
    590                                                 $rarray['real_full_path'] = ereg_replace ("^$link_info[directory]" . SEP . "$link_info[name]", $link_info['link_directory'] . SEP . $link_info['link_name'], $rarray['real_full_path']); 
     589                                                $rarray['real_full_path'] = preg_replace("/^$this->basedir/", '', $rarray['real_full_path']); 
     590                                                $rarray['real_full_path'] = preg_replace("/^$link_info[directory]" . SEP . "$link_info[name]/", $link_info['link_directory'] . SEP . $link_info['link_name'], $rarray['real_full_path']); 
    591591 
    592592                                                $p = $this->path_parts (array( 
     
    766766                        while (preg_match("/$sep"."$sep/", $basedir)) 
    767767                        { 
    768                                 $basedir = ereg_replace ($sep . $sep, $sep, $basedir); 
    769                         } 
    770  
    771                         $basedir = ereg_replace ($sep . '$', '', $basedir); 
     768                                $basedir = preg_replace("/$sep"."$sep/", $sep, $basedir); 
     769                        } 
     770 
     771                        $basedir = preg_replace("/$sep$/", '', $basedir); 
    772772 
    773773                        return $basedir; 
     
    10331033                        if (!$data['full']) 
    10341034                        { 
    1035                                 $currentdir = ereg_replace ("^/", '', $currentdir); 
     1035                                $currentdir = preg_replace('/^\//', '', $currentdir); 
    10361036                        } 
    10371037 
     
    16571657                                while (list ($num, $entry) = each ($ls)) 
    16581658                                { 
    1659                                         $newdir = ereg_replace ("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']); 
     1659                                        $newdir = preg_replace("/^$f->fake_full_path/", "$t->fake_full_path", $entry['directory']); 
    16601660                                        $this->mkdir (array( 
    16611661                                                        'string'        => $newdir.'/'.$entry['name'], 
     
    16791679                                        } 
    16801680 
    1681                                         $newdir = ereg_replace ("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']); 
     1681                                        $newdir = preg_replace("/^$f->fake_full_path/", "$t->fake_full_path", $entry['directory']); 
    16821682                                        $this->cp (array( 
    16831683                                                        'from'  => "$entry[directory]/$entry[name]", 
  • trunk/phpgwapi/inc/class.vfs_shared.inc.php

    r5921 r5940  
    624624                        ); 
    625625 
    626                         return (ereg_replace ("^\.+", '', $p->fake_name)); 
     626                        return (preg_replace('/^\.+/', '', $p->fake_name)); 
    627627                } 
    628628 
     
    761761                        while (preg_match("/$sep"."$sep/", $basedir)) 
    762762                        { 
    763                                 $basedir = ereg_replace ($sep . $sep, $sep, $basedir); 
    764                         } 
    765  
    766                         $basedir = ereg_replace ($sep . '$', '', $basedir); 
     763                                $basedir = preg_replace("/$sep"."$sep/", $sep, $basedir); 
     764                        } 
     765 
     766                        $basedir = preg_replace("/$sep$/", '', $basedir); 
    767767 
    768768                        return $basedir; 
     
    10301030                                        if (preg_match("/^$link_info[directory]\/$link_info[name](\/|$)/", $rarray['fake_full_path'])) 
    10311031                                        { 
    1032                                                 $rarray['real_full_path'] = ereg_replace ("^$this->basedir", '', $rarray['real_full_path']); 
    1033                                                 $rarray['real_full_path'] = ereg_replace ("^$link_info[directory]" . SEP . "$link_info[name]", $link_info['link_directory'] . SEP . $link_info['link_name'], $rarray['real_full_path']); 
     1032                                                $rarray['real_full_path'] = preg_replace("/^$this->basedir/", '', $rarray['real_full_path']); 
     1033                                                $rarray['real_full_path'] = preg_replace("/^$link_info[directory]" . SEP . "$link_info[name]/", $link_info['link_directory'] . SEP . $link_info['link_name'], $rarray['real_full_path']); 
    10341034 
    10351035                                                $p = $this->path_parts (array( 
     
    11971197                        if (!$data['full']) 
    11981198                        { 
    1199                                 $currentdir = ereg_replace ("^/", '', $currentdir); 
     1199                                $currentdir = preg_replace('/^\//', '', $currentdir); 
    12001200                        } 
    12011201 
  • trunk/phpgwapi/inc/class.vfs_sql.inc.php

    r5921 r5940  
    13901390                                        )) as $entry) 
    13911391                                { 
    1392                                         $newdir = ereg_replace ("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']); 
     1392                                        $newdir = preg_replace("/^$f->fake_full_path/", "$t->fake_full_path", $entry['directory']); 
    13931393                                        $this->mkdir (array( 
    13941394                                                        'string'        => $newdir.'/'.$entry['name'], 
     
    14091409                                        } 
    14101410 
    1411                                         $newdir = ereg_replace ("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']); 
     1411                                        $newdir = preg_replace("/^$f->fake_full_path/", "$t->fake_full_path", $entry['directory']); 
    14121412                                        $this->cp (array( 
    14131413                                                        'from'  => "$entry[directory]/$entry[name]", 
     
    16471647                                foreach ($ls as $entry) 
    16481648                                { 
    1649                                         $newdir = ereg_replace ("^$f->fake_full_path", $t->fake_full_path, $entry['directory']); 
     1649                                        $newdir = preg_replace("/^$f->fake_full_path/", $t->fake_full_path, $entry['directory']); 
    16501650                                        $newdir_clean = $this->clean_string (array ('string' => $newdir)); 
    16511651 
Note: See TracChangeset for help on using the changeset viewer.