]> git.deb.at Git - pkg/blosxom.git/blobdiff - blosxom.cgi
Replaced references to www.blosxom.com with blosxom.sourceforge.net
[pkg/blosxom.git] / blosxom.cgi
index 997fcc74a4a00fdc80eb0cd82265e8c64f850643..320238814f3b13092d44714c39a44326c5abe54f 100755 (executable)
@@ -2,8 +2,8 @@
 
 # Blosxom
 # Author: Rael Dornfest <rael@oreilly.com>
 
 # Blosxom
 # Author: Rael Dornfest <rael@oreilly.com>
-# Version: 2.0.1
-# Home/Docs/Licensing: http://www.blosxom.com/
+# Version: 2.0.2
+# Home/Docs/Licensing: http://blosxom.sourceforge.net/
 # Development/Downloads: http://sourceforge.net/projects/blosxom
 
 package blosxom;
 # Development/Downloads: http://sourceforge.net/projects/blosxom
 
 package blosxom;
@@ -76,7 +76,7 @@ use File::stat;
 use Time::localtime;
 use CGI qw/:standard :netscape/;
 
 use Time::localtime;
 use CGI qw/:standard :netscape/;
 
-$version = "2.0";
+$version = "2.0.2";
 
 my $fh = new FileHandle;
 
 
 my $fh = new FileHandle;
 
@@ -143,13 +143,20 @@ $template =
       return join '', <$fh> if $fh->open("< $datadir/$path/$chunk.$flavour");
     } while ($path =~ s/(\/*[^\/]*)$// and $1);
 
       return join '', <$fh> if $fh->open("< $datadir/$path/$chunk.$flavour");
     } while ($path =~ s/(\/*[^\/]*)$// and $1);
 
-    return join '', ($template{$flavour}{$chunk} || $template{error}{$chunk} || '');
+    # Check for definedness, since flavour can be the empty string
+    if (defined $template{$flavour}{$chunk}) {
+       return $template{$flavour}{$chunk};
+    } elsif (defined $template{error}{$chunk}) {
+       return $template{error}{$chunk} 
+    } else {
+       return '';
+    }
   };
 # Bring in the templates
 %template = ();
 while (<DATA>) {
   last if /^(__END__)$/;
   };
 # Bring in the templates
 %template = ();
 while (<DATA>) {
   last if /^(__END__)$/;
-  my($ct, $comp, $txt) = /^(\S+)\s(\S+)\s(.*)$/ or next;
+  my($ct, $comp, $txt) = /^(\S+)\s(\S+)(?:\s(.*))?$/ or next;
   $txt =~ s/\\n/\n/mg;
   $template{$ct}{$comp} .= $txt . "\n";
 }
   $txt =~ s/\\n/\n/mg;
   $template{$ct}{$comp} .= $txt . "\n";
 }
@@ -474,7 +481,7 @@ html date         <h3>$dw, $da $mo $yr</h3>
 html foot
 html foot         <p />
 html foot         <center>
 html foot
 html foot         <p />
 html foot         <center>
-html foot             <a href="http://www.blosxom.com/"><img src="http://www.blosxom.com/images/pb_blosxom.gif" border="0" /></a>
+html foot             <a href="http://blosxom.sourceforge.net/"><img src="http://blosxom.sourceforge.net/images/pb_blosxom.gif" border="0" /></a>
 html foot         </center>
 html foot     </body>
 html foot </html>
 html foot         </center>
 html foot     </body>
 html foot </html>