Recent Changes - Search:

PITS main list

edit sidebar

Main sidebar

PmWiki

pmwiki.org

00131

Summary: Search groups don't work
Created: 2004-10-30 14:37
Status: Closed - fixed for 2.0.devel27
Category: Bug
From: PRZ
Assigned:
Priority: 3
Version: 2 Devel 19
OS:

Description: The Search restricted to a group is supposedly called by :

Group/

But that don't work, it seems that you get results of search for the string "Group/" in all groups.

jr fixed this as follows:

  if (isset($_REQUEST['q']) && $_REQUEST['q']==) $_REQUEST['q']="";
  $opt = array_merge($opt,@$_REQUEST);
 # new code  
  $rq = stripmagic(@$_REQUEST['q']);
  if (preg_match("!^($GroupPattern(\\|$GroupPattern)*)?/!i",@$rq,$match)) 
  { 
    $opt['group'] = $match[1]; 
    $rq=str_replace($match[1].'/','',$rq);
  }
  $terms = $opt['o'] . ' ' . $rq;
 #  
 #  $terms = $opt['o'] . ' ' . stripmagic(@$_REQUEST['q']);
 #
  $terms = preg_split('/((?<!\\S)[-+]?[\'"].*?[\'"](?!\\S)|\\S+)/',
    $terms,-1,PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);

/*

 # remove...
  if (preg_match("!^($GroupPattern(\\|$GroupPattern)*)?/!i",@$terms[0],$match)) 
  { 
    $opt['group'] = @$match[1]; 
    $terms[0]=str_replace(@$match[1].'/','',$terms[0]);
  }
 */
Edit - History - Print - Recent Changes - Search
Page last modified on September 10, 2011, at 11:56 AM