Changeset 9663

Show
Ignore:
Timestamp:
05/22/10 10:14:54 (3 years ago)
Author:
p_lindheimer
Message:

fixes #4281 deprecated spilt() function to preg_split() in ARI

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/asi.php

    r4993 r9663  
    104104 
    105105      if (preg_match('/Value/',$buffer)) { 
    106         $parts = split(' ',trim($buffer)); 
     106        $parts = preg_split('/\s/',trim($buffer)); 
    107107        $response = $parts[1]; 
    108108      } 
     
    138138 
    139139      if (preg_match('/Value:/',$buffer)) { 
    140         $parts = split('Value:',trim($buffer)); 
     140        $parts = preg_split('/Value:/',trim($buffer)); 
    141141        $response = $parts[1]; 
    142142      } 
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/bootstrap.php

    r9651 r9663  
    232232  // check for PEAR 
    233233  $include_path = ini_get('include_path'); 
    234   $buf = split(':|,',$include_path); 
     234  $buf = preg_split('/:|,/',$include_path); 
    235235 
    236236  $found = 0; 
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/callme.php

    r7042 r9663  
    6464      if (preg_match('/Value: [^\s]*/', $results_elem, $matches) != 0) 
    6565      { 
    66         $parts = split(' ', trim($matches[0])); 
     66        $parts = preg_split('/\s/', trim($matches[0])); 
    6767        $callme_num = $parts[1]; 
    6868      } 
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/common.php

    r9469 r9663  
    4545      include_once($path);  
    4646      $path_parts = pathinfo($path); 
    47       list($name,$ext) = split("\.",$path_parts['basename']); 
     47      list($name,$ext) = preg_split("/\./",$path_parts['basename']); 
    4848 
    4949      // check for module and get rank 
     
    5555        $found = 0; 
    5656        if ($ARI_ADMIN_MODULES) { 
    57           $admin_modules = split(',',$ARI_ADMIN_MODULES); 
     57          $admin_modules = preg_split('/,/',$ARI_ADMIN_MODULES); 
    5858          foreach ($admin_modules as $key => $value) { 
    5959            if ($name==$value) { 
     
    6767        $disabled = 0; 
    6868        if ($ARI_DISABLED_MODULES) { 
    69           $disabled_modules = split(',',$ARI_DISABLED_MODULES); 
     69          $disabled_modules = preg_split('/,/',$ARI_DISABLED_MODULES); 
    7070          foreach ($disabled_modules as $key => $value) { 
    7171            if ($name==$value) { 
     
    145145 
    146146    $include = 0; 
    147     $files = split(';',$AMP_FUNCTIONS_FILES); 
     147    $files = preg_split('/;/',$AMP_FUNCTIONS_FILES); 
    148148    foreach ($files as $file) { 
    149149      if (is_file($file)) { 
  • freepbx/trunk/amp_conf/htdocs/recordings/includes/login.php

    r9467 r9663  
    106106 
    107107              $include_filename = ''; 
    108               $parts = split(' ',$line); 
     108              $parts = preg_split('/\s/',$line); 
    109109              if (isset($parts[1])) { 
    110110                $include_filename = trim($parts[1]); 
     
    136136            // check for user and process 
    137137            unset($value); 
    138             $parts = split('=>',$line); 
     138            $parts = preg_split('/=>/',$line); 
    139139            if (isset($parts[0])) { 
    140140              $var = $parts[0]; 
     
    145145            $var = trim($var); 
    146146            if ($var==$username && $value) { 
    147               $buf = split(',',$value); 
     147              $buf = preg_split('/,/',$value); 
    148148              if ($buf[0]==$password) {   
    149149 
     
    163163                } 
    164164 
    165                 $options = split('\|',$buf[4]); 
     165                $options = preg_split('/\|/',$buf[4]); 
    166166                foreach ($options as $option) { 
    167                   $opt_buf = split('=',$option); 
     167                  $opt_buf = preg_split('/=/',$option); 
    168168                  $voicemail_email[$opt_buf[0]] = trim($opt_buf[1]); 
    169169                } 
     
    171171                $admin = 0; 
    172172                if ($ARI_ADMIN_EXTENSIONS) { 
    173                   $extensions = split(',',$ARI_ADMIN_EXTENSIONS); 
     173                  $extensions = preg_split('/,/',$ARI_ADMIN_EXTENSIONS); 
    174174                  foreach ($extensions as $key => $value) { 
    175175                    if ($extension==$value) { 
     
    182182                $admin_callmonitor = 0; 
    183183                if ($CALLMONITOR_ADMIN_EXTENSIONS) { 
    184                   $extensions = split(',',$CALLMONITOR_ADMIN_EXTENSIONS); 
     184                  $extensions = preg_split('/,/',$CALLMONITOR_ADMIN_EXTENSIONS); 
    185185                  foreach ($extensions as $key => $value) { 
    186186                    if ($value=='all' || $extension==$value) { 
     
    209209        foreach($ASTERISK_PROTOCOLS as $protocol => $value) { 
    210210 
    211           $config_files = split(';',$value['config_files']); 
     211          $config_files = preg_split('/;/',$value['config_files']); 
    212212          foreach ($config_files as $config_file) { 
    213213 
     
    218218 
    219219                unset($value); 
    220                 $parts = split('=',$line); 
     220                $parts = preg_split('/=/',$line); 
    221221                if (isset($parts[0])) { 
    222222                  $var = trim($parts[0]); 
     
    242242                    $admin = 0; 
    243243                    if ($ARI_ADMIN_EXTENSIONS) { 
    244                       $extensions = split(',',$ARI_ADMIN_EXTENSIONS); 
     244                      $extensions = preg_split('/,/',$ARI_ADMIN_EXTENSIONS); 
    245245                      foreach ($extensions as $key => $value) { 
    246246                        if ($extension==$value) { 
     
    253253                    $admin_callmonitor = 0; 
    254254                    if ($CALLMONITOR_ADMIN_EXTENSIONS) { 
    255                       $extensions = split(',',$CALLMONITOR_ADMIN_EXTENSIONS); 
     255                      $extensions = preg_split('/,/',$CALLMONITOR_ADMIN_EXTENSIONS); 
    256256                      foreach ($extensions as $key => $value) { 
    257257                        if ($value=='all' || $extension==$value) { 
  • freepbx/trunk/amp_conf/htdocs/recordings/modules/settings.module

    r9475 r9663  
    444444              foreach ($lines as $key => $line) { 
    445445                unset($value); 
    446                 list($var,$value) = split('=>',$line); 
     446                list($var,$value) = preg_split('/=>/',$line); 
    447447                $var = trim($var); 
    448448                if ($var==$exten && $value) { 
    449449                  // write out line with password change 
    450                   $buf = split(',',$value); 
     450                  $buf = preg_split('/,/',$value); 
    451451                  $buf[0] = $voicemail_password; 
    452452                  $line = $var . " => " . join(',', $buf); 
     
    531531              foreach ($lines as $key => $line) { 
    532532                unset($value); 
    533                 list($var,$value) = split('=>',$line); 
     533                list($var,$value) = preg_split('/=>/',$line); 
    534534                $var = trim($var); 
    535535                if ($var==$exten && $value) { 
    536536                  // write out line with voicemail email change 
    537                   $buf = split(',',$value); 
     537                  $buf = preg_split('/,/',$value); 
    538538                  $buf[2] = $voicemail_email_address; 
    539539                  $buf[3] = $voicemail_pager_address; 
     
    606606        if (preg_match("/include/i",$line)) { 
    607607          $include_filename = ''; 
    608           $parts = split(' ',$line); 
     608          $parts = preg_split('/\s/',$line); 
    609609          if (isset($parts[1])) { 
    610610            $include_filename = trim($parts[1]); 
     
    631631        // check for user and process 
    632632        unset($value); 
    633         $parts = split('=>',$line); 
     633        $parts = preg_split('/=>/',$line); 
    634634        if (isset($parts[0])) { 
    635635          $var = $parts[0]; 
     
    640640        $var = trim($var); 
    641641        if ($var==$exten && $value) { 
    642           $buf = split(',',$value); 
     642          $buf = preg_split('/,/',$value); 
    643643          //if ($buf[0]==$password) { 
    644644            // authenticated 
     
    663663              $voicemail_pager_enable = 0; 
    664664            } 
    665             $options = split('\|',$buf[4]); 
     665            $options = preg_split('/\|/',$buf[4]); 
    666666            foreach ($options as $option) { 
    667               $opt_buf = split('=',$option); 
     667              $opt_buf = preg_split('/=/',$option); 
    668668              $voicemail_opts[$opt_buf[0]] = trim($opt_buf[1]); 
    669669            } 
  • freepbx/trunk/amp_conf/htdocs/recordings/modules/voicemail.module

    r9455 r9663  
    8181 
    8282    // make folder list 
    83     $paths = split(';',$ASTERISK_VOICEMAIL_PATH); 
     83    $paths = preg_split('/;/',$ASTERISK_VOICEMAIL_PATH); 
    8484    $i = 0; 
    8585    while ($ASTERISK_VOICEMAIL_FOLDERS[$i]) { 
     
    189189 
    190190      $mailbox_rx = getArgument($args,'mailbox_rx'); 
    191       list($context_rx,$extension_rx) = split('/',$mailbox_rx); 
     191      list($context_rx,$extension_rx) = preg_split('/\//',$mailbox_rx); 
    192192      if ($extension_rx=='') { 
    193193        $_SESSION['ari_error'] 
     
    214214    // Check email address(es) and construct address list for TO field. 
    215215    // TO 
    216     $email_list = split(",", $em_to); 
     216    $email_list = preg_split("/,/", $em_to); 
    217217    foreach ($email_list as $list_elem) { 
    218218      $list_elem = trim($list_elem); 
     
    373373    $sort = ($sort=='' || strtolower($sort) == 'desc') ? 'desc' : 'asc'; 
    374374 
    375     $paths = split(';',$ASTERISK_VOICEMAIL_PATH); 
     375    $paths = preg_split('/;/',$ASTERISK_VOICEMAIL_PATH); 
    376376 
    377377    $displayname = $_SESSION['ari_user']['displayname']; 
     
    432432        // get username and add to options 
    433433        if (preg_match("/\=\>/i",$line)) { 
    434           list($username,$value) = split('=>',$line); 
     434          list($username,$value) = preg_split('/=>/',$line); 
    435435          $username = trim($username); 
    436436          if ($username!=$_SESSION['ari_user']['extension']) { 
    437437            //$ext_array[] = $username . "|" . $forwardContext; 
    438             list(,$real_name,) = split(",",$value,3); 
     438            list(,$real_name,) = preg_split("/,/",$value,3); 
    439439            $ext_array[] = $real_name . "|" . $username . "|" . $forwardContext; 
    440440          } 
     
    755755          foreach ($lines as $key => $line) { 
    756756            unset($value); 
    757             list($key,$value) = split('=',$line); 
     757            list($key,$value) = preg_split('/=/',$line); 
    758758            if ($value) { 
    759759 
     
    826826      $path = fixPathSlash($path_parts['dirname']); 
    827827 
    828       list($name,$ext) = split("\.",$path_parts['basename']); 
     828      list($name,$ext) = preg_split("/\./",$path_parts['basename']); 
    829829 
    830830      // delete all related files using a wildcard 
     
    863863 
    864864    // recieving path 
    865     $paths = split(';',$ASTERISK_VOICEMAIL_PATH); 
     865    $paths = preg_split('/;/',$ASTERISK_VOICEMAIL_PATH); 
    866866    $path_rx = appendPath($paths[0],$context_rx); 
    867867    if (!is_dir($path_rx)) { 
     
    901901            //so that files like msg0000.7025f35d463ebbafa101db8a88c71b681aa8443d.mp3 
    902902            //don't interfere with finding the true last file number 
    903             list($name,$ext) = split("\.",$path_parts['basename'],2); 
     903            list($name,$ext) = preg_split("/\./",$path_parts['basename'],2); 
    904904            $num = preg_replace("/[a-zA-Z]/",'', $name); 
    905905            if ($num > $lastNum) { 
     
    929929      $path = $path_parts['dirname']; 
    930930      $path = fixPathSlash($path); 
    931       list($name,$ext) = split("\.",$path_parts['basename']); 
     931      list($name,$ext) = preg_split("/\./",$path_parts['basename']); 
    932932      if (is_dir($path)) { 
    933933 
     
    942942            //so that files like msg0000.7025f35d463ebbafa101db8a88c71b681aa8443d.mp3 
    943943            //don't get clobbered by preg_replace() of digits 
    944             list($name,$ext) = split("\.",$path_parts['basename'],2); 
     944            list($name,$ext) = preg_split("/\./",$path_parts['basename'],2); 
    945945            $folder_rx = preg_replace("/\d+/",sprintf("%0" . $lastNumLen . "d",$lastNum),$name) . "." . $ext;  
    946946            $dst = appendPath($path_rx,$folder_rx); 
     
    10191019        foreach ($lines as $key => $line) { 
    10201020          unset($value); 
    1021           list($key,$value) = split('=',$line); 
     1021          list($key,$value) = preg_split('/=/',$line); 
    10221022          $key = trim($key); 
    10231023          $value = trim($value);