includes/paths.php
changeset 138 13561bde2e2c
parent 118 0c5efda996bf
child 142 ca9118d9c0f2
equal deleted inserted replaced
137:3bce0c320e80 138:13561bde2e2c
   743     $cache = array_keys($search->index);
   743     $cache = array_keys($search->index);
   744     if ( count($cache) < 1 )
   744     if ( count($cache) < 1 )
   745     {
   745     {
   746       return false;
   746       return false;
   747     }
   747     }
       
   748     foreach ( $cache as $key => $_unused )
       
   749     {
       
   750       $cache[$key] = $db->escape( $cache[$key] );
       
   751     }
   748     $cache = "query LIKE '%" . implode ( "%' OR query LIKE '%", $cache ) . "%'";
   752     $cache = "query LIKE '%" . implode ( "%' OR query LIKE '%", $cache ) . "%'";
   749     $db->sql_query('DELETE FROM '.table_prefix.'search_cache WHERE '.$cache);
   753     $sql = 'DELETE FROM '.table_prefix.'search_cache WHERE '.$cache;
       
   754     $db->sql_query($sql);
   750     
   755     
   751     $query = $db->sql_query('SELECT word,page_names FROM '.table_prefix.'search_index WHERE '.$keys.';');
   756     $query = $db->sql_query('SELECT word,page_names FROM '.table_prefix.'search_index WHERE '.$keys.';');
   752     
   757     
   753     while($row = $db->fetchrow())
   758     while($row = $db->fetchrow())
   754     {
   759     {