Ticket #1745: split_removal.patch

File split_removal.patch, 6.6 kB (added by openhaus, 2 years ago)

Patch to replace split function

  • lib/SGL/Config.php

    old new  
    149149    { 
    150150        $ret = false; 
    151151        if (is_string($key) && is_scalar($value)) { 
    152             $aKeys = split('\.', trim($key)); 
     152            $aKeys = preg_split('/\./', trim($key)); 
    153153 
    154154            //  it's a static call 
    155155            if (isset($aKeys[0]) && isset($aKeys[1])) { 
     
    455455        if (empty($str)) { 
    456456            return false; 
    457457        } 
    458         $aSplitResult = split('\^', $str); 
     458        $aSplitResult = preg_split('/\^/', $str); 
    459459        $aParams = array( 
    460460            'moduleName'    => null, 
    461461            'managerName'   => null, 
  • lib/SGL/HtmlRenderer/SmartyStrategy.php

    old new  
    9292    { 
    9393        if (!is_readable($resourceName)) { 
    9494            //  parse module_name 
    95             list($moduleName, $templateName) = split('/', $resourceName); 
     95            list($moduleName, $templateName) = preg_split('#/#', $resourceName); 
    9696            $arr = array($moduleName, $templateName); 
    9797            $newResourceName = $oSmarty->template_dir . '/' . join('/', $arr); 
    9898            if (file_exists($newResourceName)) { 
  • modules/s9ywrapper/classes/BlogMgr.php

    old new  
    7878        SGL::logMessage(null, PEAR_LOG_DEBUG); 
    7979 
    8080        require_once 'HTTP/Request.php'; 
    81         $phpSelfParts = split('\?', $_SERVER['PHP_SELF']); 
     81        $phpSelfParts = preg_split('(/\?/', $_SERVER['PHP_SELF']); 
    8282        $s9yUri = SGL_BASE_URL . '/serendipity/index.php?'.@$phpSelfParts[1]; 
    8383        $req = &new HTTP_Request($s9yUri); 
    8484        if ($_POST) { 
  • modules/randommsg/classes/RndMsgMgr.php

    old new  
    146146        if ($input->msgUpload) { 
    147147            $aLines = $this->file2($input->msgFileTmpName); 
    148148        } else { 
    149             $aLines = split($this->crlf, $input->addMsgsText); 
     149            $aLines = preg_split("/".$this->crlf."/", $input->addMsgsText); 
    150150        } 
    151151        $success = true; 
    152152        foreach ($aLines as $rndmsg) { 
  • modules/navigation/classes/NavigationDAO.php

    old new  
    217217                } 
    218218                //  split off anchor if exists 
    219219                if (stristr($section['resource_uri'], '#')) { 
    220                     list(,$anchor) = split("#", $section['resource_uri']); 
     220                    list(,$anchor) = preg_split('/#/', $section['resource_uri']); 
    221221                    $section['anchor'] = $anchor; 
    222222                } 
    223223            } 
     
    545545        //  intercept a list of constants occuring in quotes, 
    546546        //  ie 'perms' => "SGL_GUEST, SGL_MEMBER, SGL_ADMIN", 
    547547        if (is_string($section['perms'])) { 
    548             $aConstants = split(',', $section['perms']); 
     548            $aConstants = preg_split('/,/', $section['perms']); 
    549549            if (is_array($aConstants)) { 
    550550                $aPerms = array(); 
    551551                foreach ($aConstants as $myconstant) { 
     
    626626                $section['resource_uri'] = 'uriAlias:' . $aliasId.':'.$section['resource_uri']; 
    627627            } 
    628628        } else { 
    629             $this->deleteAliasBySectionId($section['section_id']);   
     629            $this->deleteAliasBySectionId($section['section_id']); 
    630630        } 
    631631 
    632632        //  update translations 
  • 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/guestbook/classes/Output.php

    old new  
    3838// +---------------------------------------------------------------------------+ 
    3939// $Id: Output.php,v 1.0 2006/07/01 00:26:16 demian Exp $ 
    4040 
    41 class GuestbookOutput  
     41class GuestbookOutput 
    4242{ 
    4343 
    4444    /** 
     
    4646     * Ex: user@domain.com => <span>user</span>&#64;<!-- -->domain&#46;com 
    4747     * 
    4848     * @access  public 
    49      * @param   string  $email  
     49     * @param   string  $email 
    5050     * @return  string  $email ofucated 
    5151     */ 
    5252    function emailObfuscator($email) 
    5353    { 
    54         SGL::logMessage(null, PEAR_LOG_DEBUG);        
    55          
     54        SGL::logMessage(null, PEAR_LOG_DEBUG); 
     55 
    5656        $email = str_replace('.','&#46;',$email); // Replace . with &#46; 
    57         $aEmail = split('@',$email); 
     57        $aEmail = preg_split('/@/',$email); 
    5858        $data = '<span>'.$aEmail[0].'</span>&#64;<!-- -->'.$aEmail[1]; 
    59         
    60         return $data;      
     59 
     60        return $data; 
    6161    } 
    6262} 
    6363?> 
  • 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 {