فهرست منبع

* Inhibit warning in _mostreferencednicks when a nick is referenced
before being used first.
* Added a test suite to CVS at /test.

Christoph Berg 21 سال پیش
والد
کامیت
55c8f683a7
2فایلهای تغییر یافته به همراه9 افزوده شده و 2 حذف شده
  1. 5 0
      docs/Changelog
  2. 4 2
      modules/Pisg/HTMLGenerator.pm

+ 5 - 0
docs/Changelog

@@ -1,7 +1,12 @@
 pisg (0.63) - ??
+   Morten:
    * A new option, ShowLines, for disabling the column with the number of
      lines in "Most Active Nicks" has been added.
+   Christoph:
    * Updated the Swedish foul1 template (thanks, Torbjörn Svensson).
+   * Inhibit warning in _mostreferencednicks when a nick is referenced
+     before being used first.
+   * Added a test suite to CVS at /test.
 
 pisg (0.62) - Sat Dec, 11th 2004
    Changes by Christoph Berg:

+ 4 - 2
modules/Pisg/HTMLGenerator.pm

@@ -1785,11 +1785,13 @@ sub _mostreferencednicks
         _html("<td class=\"tdtop\"><b>" . $self->_template_text('lastused') . "</b></td></tr>");
 
         for(my $i = 0; $i < $self->{cfg}->{nickhistory}; $i++) {
-            last unless $i <= $#popular;
+            last if $i >= @popular;
             my $a = $i + 1;
             my $popular   = $self->_format_word($popular[$i]);
             my $wordcount = $self->{stats}->{wordcounts}{$popular[$i]};
-            my $lastused  = $self->_format_word($self->{stats}->{wordnicks}{$popular[$i]});
+            my $lastused  = $self->_format_word($self->{stats}->{wordnicks}{$popular[$i]} || "");
+            # this is undefined when a nick is referenced before being used
+            # first (this is a minor bug we ignore here, see test/01.cfg)
 
             my $class;
             if ($a == 1) {