aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2011-08-30 11:37:38 -0400
committerJoey Hess <joey@kitenet.net>2011-08-30 11:37:38 -0400
commit4af7b2c14d548beaf09f100e7fc6efc39e9c73a2 (patch)
tree0c070a62bc0f72512aa713ad4c40cb8afdad39b2
parent108d118dc36a7cb6e130ed30dcbb4765f93dbc2d (diff)
downloadikiwiki-4af7b2c14d548beaf09f100e7fc6efc39e9c73a2.tar
ikiwiki-4af7b2c14d548beaf09f100e7fc6efc39e9c73a2.tar.gz
search: Fix encoding bug in calculation of maximum term size.
-rw-r--r--IkiWiki/Plugin/search.pm3
-rw-r--r--debian/changelog1
2 files changed, 3 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/search.pm b/IkiWiki/Plugin/search.pm
index 8138cd67f..42d2e0d30 100644
--- a/IkiWiki/Plugin/search.pm
+++ b/IkiWiki/Plugin/search.pm
@@ -192,7 +192,8 @@ sub pageterm ($) {
# 240 is the number used by omindex to decide when to hash an
# overlong term. This does not use a compatible hash method though.
- if (length $page > 240) {
+ eval q{use Encode};
+ if (length encode_utf8($page) > 240) {
eval q{use Digest::SHA};
if ($@) {
debug("search: ".sprintf(gettext("need Digest::SHA to index %s"), $page)) if $@;
diff --git a/debian/changelog b/debian/changelog
index cd0b3a114..5295030d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ ikiwiki (3.20110716) UNRELEASED; urgency=low
* Update to jquery 1.6.2, and jquery-ui 1.8.14.
* Use lockf rather than flock when taking the cgilock, for better
portability.
+ * search: Fix encoding bug in calculation of maximum term size.
-- Joey Hess <joeyh@debian.org> Tue, 19 Jul 2011 11:22:52 -0400