diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2011-06-09 02:08:57 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-06-09 09:22:44 -0700 |
commit | 2c162b56f370f5c33e6a945e6922d598006c5ec4 (patch) | |
tree | ebb5ca70b119db734967b60d37051c4f897fb4e0 /gitweb | |
parent | 2cbd969bcfef26b32c78bfbe475ce0ad9646ea06 (diff) | |
download | git-2c162b56f370f5c33e6a945e6922d598006c5ec4.tar.gz |
gitweb: do not misparse nonnumeric content tag files that contain a digit
v1.7.6-rc0~27^2~4 (gitweb: Change the way "content tags" ('ctags') are
handled, 2011-04-29) tried to make gitweb's tag cloud feature more
intuitive for webmasters by checking whether the ctags/<label> under
a project's .git dir contains a number (representing the strength of
association to <label>) before treating it as one.
With that change, after putting '$feature{'ctags'}{'default'} = [1];'
in your $GITWEB_CONFIG, you could do
echo Linux >.git/ctags/linux
and gitweb would treat that as a request to tag the current repository
with the Linux tag, instead of the previous behavior of writing an
error page embedded in the projects list that triggers error messages
from Chromium and Firefox about malformed XML.
Unfortunately the pattern (\d+) used to match numbers is too loose,
and the "XML declaration allowed only at the start of the document"
error can still be experienced if you write "Linux-2.6" in place of
"Linux" in the example above. Fix it by tightening the pattern to
^\d+$.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ebf2d1cf2c..1b83a8d0a0 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2644,7 +2644,7 @@ sub git_get_project_ctags { close $ct; (my $ctag = $tagfile) =~ s#.*/##; - if ($val =~ /\d+/) { + if ($val =~ /^\d+$/) { $ctags->{$ctag} = $val; } else { $ctags->{$ctag} = 1; |