Ticket #1745: split_removal_trunk.patch

File split_removal_trunk.patch, 2.6 kB (added by openhaus, 2 years ago)

Patch to replace split function

  • modules/navigation/classes/NavigationDAO.php

    old new  
    218218                } 
    219219                //  split off anchor if exists 
    220220                if (stristr($section['resource_uri'], '#')) { 
    221                     list(,$anchor) = split("#", $section['resource_uri']); 
     221                    list(,$anchor) = preg_split("/#/", $section['resource_uri']); 
    222222                    $section['anchor'] = $anchor; 
    223223                } 
    224224            } 
     
    546546        //  intercept a list of constants occuring in quotes, 
    547547        //  ie 'perms' => "SGL_GUEST, SGL_MEMBER, SGL_ADMIN", 
    548548        if (is_string($section['perms'])) { 
    549             $aConstants = split(',', $section['perms']); 
     549            $aConstants = preg_split('/,/', $section['perms']); 
    550550            if (is_array($aConstants)) { 
    551551                $aPerms = array(); 
    552552                foreach ($aConstants as $myconstant) { 
  • modules/navigation/classes/SimpleDriver.php

    old new  
    654654        //  extract anchor and place at end if exists 
    655655        if (stristr($url, '#')) { 
    656656            $anchorStart           = strpos($url, '#'); 
    657             list(,$anchorFragment) = split('#', $url); 
     657            list(,$anchorFragment) = preg_split('/#/', $url); 
    658658            $anchorOffset          = (strpos($anchorFragment, '&')) + 1; 
    659659            $anchorEnd             = $anchorStart + $anchorOffset; 
    660660            $namedAnchor           = substr($url, $anchorStart, $anchorOffset); 
  • modules/user/classes/RoleMgr.php

    old new  
    355355    function _parsePermsString($sPerms) 
    356356    { 
    357357        SGL::logMessage(null, PEAR_LOG_DEBUG); 
    358         $aTmpPerms = split(':', $sPerms); 
     358        $aTmpPerms = preg_split('/:/', $sPerms); 
    359359        if (count($aTmpPerms) > 0) { 
    360360            array_pop($aTmpPerms); 
    361361            $aPerms = array(); 
    362362            foreach ($aTmpPerms as $perm) { 
    363363                //  chop at caret 
    364                 list($permName, $permId) = split('\^', $perm); 
     364                list($permName, $permId) = preg_split('/\^/', $perm); 
    365365                $aPerms[$permId] = $permName; 
    366366            } 
    367367        } else {