From: Junio C Hamano Date: Mon, 05 Mar 2012 05:16:09 GMT Subject: Re: [PATCH (for maint)] gitweb: Fix fixed string (non-regexp) project search Message-ID: <7vfwdn631i.fsf@alter.siamese.dyndns.org> In-Reply-To: <201203041035.03133.jnareb@gmail.com> Jakub Narebski writes: > And here is the patch for maint > -->8-- -------------------------------------------------------- -->8-- > Subject: gitweb: Fix fixed string (non-regexp) project search > > Use $search_regexp, where regex metacharacters are quoted, for > searching projects list, rather than $searchtext, which contains > original search term. > > Reported-by: Ramsay Jones > Signed-off-by: Jakub Narebski > --- > gitweb/gitweb.perl | 20 +++++++++++--------- > 1 files changed, 11 insertions(+), 9 deletions(-) > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index d5dbd64..e248792 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -5290,9 +5290,11 @@ sub git_project_list_body { > @projects = fill_project_list_info(\@projects); > # searching projects require filling to be run before it > @projects = search_projects_list(\@projects, > - 'searchtext' => $searchtext, > - 'tagfilter' => $tagfilter) > - if ($tagfilter || $searchtext); > + 'search_regexp' => $search_regexp, > + 'tagfilter' => $tagfilter) > + if ($tagfilter || $search_regexp); > + # fill the rest > + @projects = fill_project_list_info(\@projects); Hmph, didn't you already call fill_project_list_info(\@projects) before search_projects_list() already?