From: Joey Hess <joey@gnu.kitenet.net>
Date: Sun, 15 Mar 2009 21:39:14 +0000 (-0400)
Subject: Fix bug that caused weird things to appear as page types.
X-Git-Tag: 3.08~2
X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/c176dcde982dfa3095cf7c2d05db4cb71c1713e5

Fix bug that caused weird things to appear as page types.

The problem was introduced by the recent noextension patches.
Object autovivification caused junk to get into %htmlize,
and all keys of that showed up as page types.
---

diff --git a/IkiWiki.pm b/IkiWiki.pm
index a876bbb44..ee07258ec 100644
--- a/IkiWiki.pm
+++ b/IkiWiki.pm
@@ -639,8 +639,10 @@ sub pagetype ($) {
 	if ($file =~ /\.([^.]+)$/) {
 		return $1 if exists $hooks{htmlize}{$1};
 	}
-	elsif ($hooks{htmlize}{basename($file)}{noextension}) {
-		return basename($file);
+	my $base=basename($file);
+	if (exists $hooks{htmlize}{$base} &&
+	    $hooks{htmlize}{$base}{noextension}) {
+		return $base;
 	}
 	return;
 }
diff --git a/debian/changelog b/debian/changelog
index 77b5d9fa6..2c9d1a75a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ ikiwiki (3.08) UNRELEASED; urgency=low
   * git: Fix utf-8 encoding of author names.
   * git: Manually decode git output from utf-8, avoids
     warning messages on invalidly encoded output.
+  * Fix bug that caused weird things to appear as page types.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 09 Mar 2009 14:00:21 -0400