decir/search.php
author Dan
Thu, 29 Nov 2007 21:48:02 -0500
changeset 11 5585ac341820
permissions -rw-r--r--
SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     1
<?php
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     2
/*
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     3
 * Decir
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     4
 * Version 0.1
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     5
 * Copyright (C) 2007 Dan Fuhry
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     6
 * search.php - Integration with Enano's search system
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     7
 *
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     8
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
     9
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    10
 *
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    11
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    12
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    13
 */
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    14
 
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    15
$plugins->attachHook('search_global_inner', 'decir_search($query, $query_phrase, $scores, $page_data, $case_sensitive, $word_list);');
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    16
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    17
/**
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    18
 * Searches the forums for the specified search terms. Called from a hook.
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    19
 * @access private
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    20
 */
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    21
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    22
function decir_search(&$query, &$query_phrase, &$scores, &$page_data, &$case_sensitive, &$word_list)
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    23
{
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    24
  global $db, $session, $paths, $template, $plugins; // Common objects
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    25
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    26
  require_once( DECIR_ROOT . '/bbcode.php' );
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    27
  require_once( DECIR_ROOT . '/functions_viewtopic.php' );
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    28
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    29
  // Based on the search function from Snapr
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    30
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    31
  // Let's do this all in one query
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    32
  $terms = array(
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    33
      'any' => array_merge($query['any'], $query_phrase['any']),
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    34
      'req' => array_merge($query['req'], $query_phrase['req']),
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    35
      'not' => $query['not']
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    36
    );
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    37
  $where = array('any' => array(), 'req' => array(), 'not' => array());
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    38
  $where_any =& $where['any'];
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    39
  $where_req =& $where['req'];
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    40
  $where_not =& $where['not'];
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    41
  $title_col = ( $case_sensitive ) ? 'p.post_subject' : 'lcase(p.post_subject)';
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    42
  $desc_col = ( $case_sensitive ) ? 't.post_text' : 'lcase(t.post_text)';
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    43
  foreach ( $terms['any'] as $term )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    44
  {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    45
    $term = escape_string_like($term);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    46
    if ( !$case_sensitive )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    47
      $term = strtolower($term);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    48
    $where_any[] = "( $title_col LIKE '%{$term}%' OR $desc_col LIKE '%{$term}%' )";
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    49
  }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    50
  foreach ( $terms['req'] as $term )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    51
  {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    52
    $term = escape_string_like($term);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    53
    if ( !$case_sensitive )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    54
      $term = strtolower($term);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    55
    $where_req[] = "( $title_col LIKE '%{$term}%' OR $desc_col LIKE '%{$term}%' )";
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    56
  }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    57
  foreach ( $terms['not'] as $term )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    58
  {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    59
    $term = escape_string_like($term);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    60
    if ( !$case_sensitive )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    61
      $term = strtolower($term);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    62
    $where_not[] = "$title_col NOT LIKE '%{$term}%' AND $desc_col NOT LIKE '%{$term}%'";
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    63
  }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    64
  if ( empty($where_any) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    65
    unset($where_any, $where['any']);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    66
  if ( empty($where_req) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    67
    unset($where_req, $where['req']);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    68
  if ( empty($where_not) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    69
    unset($where_not, $where['not']);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    70
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    71
  $where_any = '(' . implode(' OR ', $where_any) . '' . ( isset($where['req']) || isset($where['not']) ? ' OR 1 = 1' : '' ) . ')';
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    72
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    73
  if ( isset($where_req) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    74
    $where_req = implode(' AND ', $where_req);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    75
  if ( isset($where_not) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    76
  $where_not = implode( 'AND ', $where_not);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    77
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    78
  $where = implode(' AND ', $where);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    79
  $sql = "SELECT p.post_id, p.post_subject, t.post_text, p.poster_name, p.poster_id, u.username, p.edit_count, p.last_edited_by, p.timestamp,\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    80
         . "  p.post_deleted, u2.username AS editor, p.edit_reason, u.user_level, u.reg_time, t.post_text, t.bbcode_uid\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    81
         . "    FROM " . table_prefix . "decir_posts AS p\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    82
         . "  LEFT JOIN " . table_prefix . "decir_posts_text AS t\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    83
         . "    ON ( t.post_id = p.post_id )\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    84
         . "  LEFT JOIN " . table_prefix . "users AS u2\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    85
         . "    ON (u2.user_id=p.last_edited_by OR p.last_edited_by IS NULL)\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    86
         . "  LEFT JOIN " . table_prefix . "users AS u\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    87
         . "    ON ( u.user_id = p.poster_id )\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    88
         . "  WHERE ( $where ) AND post_deleted != 1\n"
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    89
         . "  GROUP BY p.post_id;";
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    90
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    91
  if ( !($q = $db->sql_unbuffered_query($sql)) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    92
  {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    93
    $db->_die('Error is in auto-generated SQL query in the Decir plugin search module');
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    94
  }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    95
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    96
  $postbit = new DecirPostbit();
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    97
  
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    98
  if ( $row = $db->fetchrow() )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
    99
  {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   100
    do
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   101
    {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   102
      $idstring = 'ns=DecirPost;pid=' . $row['post_id'];
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   103
      foreach ( $word_list as $term )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   104
      {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   105
        $func = ( $case_sensitive ) ? 'strstr' : 'stristr';
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   106
        $inc = ( $func($row['post_subject'], $term) ? 1.5 : ( $func($row['text'], $term) ? 1 : 0 ) );
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   107
        ( isset($scores[$idstring]) ) ? $scores[$idstring] = $scores[$idstring] + $inc : $scores[$idstring] = $inc;
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   108
      }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   109
      // Generate text...
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   110
      $text = render_bbcode($row['post_text'], $row['bbcode_uid']);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   111
      $text = highlight_and_clip_search_result($text, $word_list);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   112
      $post_length = strlen($row['post_text']);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   113
      
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   114
      $row['post_text'] = $text;
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   115
      $rendered_postbit = $postbit->_render('', $row);
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   116
      
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   117
      // Inject result
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   118
      
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   119
      if ( isset($scores[$idstring]) )
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   120
      {
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   121
        // echo('adding image "' . $row['img_title'] . '" to results<br />');
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   122
        $page_data[$idstring] = array(
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   123
          'page_name' => highlight_search_result(htmlspecialchars($row['post_subject']), $word_list),
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   124
          'page_text' => $rendered_postbit,
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   125
          'score' => $scores[$idstring],
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   126
          'page_note' => '[Forum post]',
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   127
          'page_id' => strval($row['post_id']),
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   128
          'namespace' => 'DecirPost',
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   129
          'page_length' => $post_length,
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   130
        );
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   131
      }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   132
    }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   133
    while ( $row = $db->fetchrow() );
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   134
  }
5585ac341820 SECURITY: fix stupid XSS vulnerability on initial post submit; add in support for the new search API
Dan
parents:
diff changeset
   135
}