Changeset 6534

Show
Ignore:
Timestamp:
09/01/08 18:43:37 (5 years ago)
Author:
ethans
Message:

I think I got all the instances of LIKE _'s that need to be escaped properly in sqlite3

Fixes #3129

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/functions.inc.php

    r6533 r6534  
    34743474    // see if they're still using the old dialprefix method 
    34753475    if ($amp_conf["AMPDBENGINE"] == "sqlite3")  { 
    3476       $sql ="SELECT variable,value FROM globals WHERE variable LIKE 'DIAL_OUT_%'"; 
     3476      $sql ="SELECT variable,value FROM globals WHERE variable LIKE 'DIAL\_OUT\_%' ESCAPE '\'"; 
    34773477    } 
    34783478    else  { 
     
    35353535      // delete old values 
    35363536      if ($amp_conf["AMPDBENGINE"] == "sqlite3")  { 
    3537         $sql = "DELETE FROM globals WHERE (variable LIKE 'DIAL_OUT_%') OR (variable = 'OUT') "; 
     3537        $sql = "DELETE FROM globals WHERE (variable LIKE 'DIAL\_OUT\_%') ESCAPE '\' OR (variable = 'OUT') "; 
    35383538      } 
    35393539      else  { 
     
    36553655 
    36563656  //Retrieve each trunk tech for later lookup 
    3657   $sql="select * from globals WHERE variable LIKE 'OUT\\_%'"; 
     3657        if ($amp_conf["AMPDBENGINE"] == "sqlite3")  { 
     3658    $sql="select * from globals WHERE variable LIKE 'OUT\_%' ESCAPE '\'"; 
     3659  } 
     3660  else  { 
     3661    $sql="select * from globals WHERE variable LIKE 'OUT\\_%'"; 
     3662  } 
    36583663        $result = $db->getAll($sql); 
    36593664        if(DB::IsError($result)) {