diff options
author | Joey Hess <joey@kitenet.net> | 2011-08-30 11:37:38 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-08-30 11:37:38 -0400 |
commit | 4af7b2c14d548beaf09f100e7fc6efc39e9c73a2 (patch) | |
tree | 0c070a62bc0f72512aa713ad4c40cb8afdad39b2 /IkiWiki/Plugin | |
parent | 108d118dc36a7cb6e130ed30dcbb4765f93dbc2d (diff) | |
download | ikiwiki-4af7b2c14d548beaf09f100e7fc6efc39e9c73a2.tar ikiwiki-4af7b2c14d548beaf09f100e7fc6efc39e9c73a2.tar.gz |
search: Fix encoding bug in calculation of maximum term size.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/search.pm | 3 |
1 files changed, 2 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 $@; |