From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH (BUGFIX)] gitweb: Handle invalid regexp in regexp search
Date: Fri, 02 Mar 2012 19:44:39 +0000 [thread overview]
Message-ID: <4F512327.3050504@ramsay1.demon.co.uk> (raw)
In-Reply-To: <20120228183919.26435.86795.stgit@localhost.localdomain>
Jakub Narebski wrote:
> When using regexp search ('sr' parameter / $search_use_regexp variable
> is true), check first that regexp is valid.
>
> Without this patch we would get an error from Perl during search (if
> searching is performed by gitweb), or highlighting matches substring
> (if applicable), if user provided invalid regexp... which means broken
> HTML, with error page (including HTTP headers) generated after gitweb
> already produced some output.
>
> Add test that illustrates such error: for example for regexp "*\.git"
> we would get the following error:
>
> Quantifier follows nothing in regex; marked by <-- HERE in m/* <-- HERE \.git/
> at /var/www/cgi-bin/gitweb.cgi line 3084.
>
> Reported-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
> Signed-off-by: Jakub Narebski <jnareb@gmail.com>
> ---
> See "Re: gitweb: (potential) problems with new installation"
> http://thread.gmane.org/gmane.comp.version-control.git/191746
This patch solves the problem for me when using a regex search
(re checkbox checked), but *not* for a non-regex search.
If you have a leading '*' or '+', in the non-regex case, then you
still get the above complaint (and xml error page etc.), although
the line number has changed slightly from that given above.
ATB,
Ramsay Jones
next prev parent reply other threads:[~2012-03-02 19:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-28 18:41 [PATCH (BUGFIX)] gitweb: Handle invalid regexp in regexp search Jakub Narebski
2012-02-28 19:45 ` Junio C Hamano
2012-02-29 15:56 ` Jakub Narebski
2012-03-02 19:44 ` Ramsay Jones [this message]
2012-03-02 22:34 ` [PATCH (BUGFIX)] gitweb: Fix fixed string (non-regexp) project search Jakub Narebski
2012-03-03 0:08 ` Junio C Hamano
2012-03-03 10:55 ` Jakub Narebski
2012-03-04 9:35 ` [PATCH (for maint)] " Jakub Narebski
2012-03-05 5:16 ` Junio C Hamano
2012-03-05 8:59 ` Jakub Narebski
2012-03-05 17:01 ` Junio C Hamano
2012-03-05 23:27 ` Junio C Hamano
2012-03-06 11:59 ` Jakub Narebski
2012-03-04 18:00 ` [PATCH (BUGFIX)] " Jakub Narebski
2012-03-04 23:08 ` Junio C Hamano
2012-03-05 9:03 ` Jakub Narebski
2012-03-05 19:06 ` Ramsay Jones
2012-03-06 12:40 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F512327.3050504@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.