Changeset 3174

Show
Ignore:
Timestamp:
11/23/06 13:43:08 (7 years ago)
Author:
p_lindheimer
Message:

#1423 and #1424: fixes error in phpagi.php that strips off leading/trailing () in AGI args and makes followme with confirmation fail when on DIAL_OPTIONS set. Needs some more testing and another set of eyes before comitting to 2.2 branch as the change effects every agi script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/trunk/amp_conf/agi-bin/phpagi.php

    r2499 r3174  
    15861586        foreach($parse as $token) 
    15871587        { 
    1588           if($in_token) // we previously hit a token starting with ')' but not ending in ')' 
     1588          if($in_token) // we previously hit a token starting with '(' but not ending in ')' 
    15891589          { 
    1590             $ret['data'] .= ' ' . trim($token, '() '); 
     1590      $tmp = trim($token); 
     1591      $tmp = $tmp{0} == '(' ? substr($tmp,1):$tmp; 
     1592      $tmp = substr($tmp,-1) == ')' ? substr($tmp,0,strlen($tmp)-1):$tmp; 
     1593      $ret['data'] .= ' ' . trim($tmp); 
    15911594            if($token{strlen($token)-1} == ')') $in_token = false; 
    15921595          } 
     
    15941597          { 
    15951598            if($token{strlen($token)-1} != ')') $in_token = true; 
    1596             $ret['data'] .= ' ' . trim($token, '() '); 
     1599      $tmp = trim(substr($token,1)); 
     1600      $tmp = $in_token ? $tmp : substr($tmp,0,strlen($tmp)-1); 
     1601      $ret['data'] .= ' ' . trim($tmp); 
    15971602          } 
    15981603          elseif(strpos($token, '='))