Ticket #1485051: db.diff

File db.diff, 1.1 kB (added by jeblair, 7 months ago)

check enable_caching before issuing deletes from cache tables

  • program/include/main.inc

    === modified file 'program/include/main.inc'
     
    924924  if (empty($CONFIG['message_cache_lifetime'])) 
    925925    return; 
    926926   
     927  if ($CONFIG['enable_caching']!==TRUE) 
     928    return; 
     929 
    927930  // get target timestamp 
    928931  $ts = get_offset_time($CONFIG['message_cache_lifetime'], -1); 
    929932   
  • program/include/session.inc

    === modified file 'program/include/session.inc'
     
    106106  if ($DB->is_error()) 
    107107    return FALSE; 
    108108   
    109   // delete session entries in cache table 
    110   $DB->query("DELETE FROM ".get_table_name('cache')." 
    111               WHERE  session_id=?", 
    112               $key); 
    113                
     109  if ($CONFIG['enable_caching']===TRUE) 
     110  { 
     111    // delete session entries in cache table 
     112    $DB->query("DELETE FROM ".get_table_name('cache')." 
     113                  WHERE  session_id=?", 
     114                      $key); 
     115  }               
    114116  $DB->query("DELETE FROM ".get_table_name('session')." 
    115117              WHERE sess_id=?", 
    116118              $key);