From df82b5e62a1066752d9260728485772dbafae8c5 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 16 Jan 2009 14:29:46 +0100 Subject: po: when possible, disable use of Text::WrapI18N in po4a; else warn about too old po4a Signed-off-by: intrigeri --- IkiWiki/Plugin/po.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'IkiWiki') diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index f826f9503..0a970284c 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -10,6 +10,16 @@ use warnings; use strict; use IkiWiki 3.00; use Encode; +BEGIN { + eval 'use Locale::Po4a::Common qw(nowrapi18n)'; + if ($@) { + warning(sprintf(gettext('%s is too old, can not disable %s; '. + 'a denial of service can thus be '. + 'triggered by malicious content'), + 'Locale::Po4a', 'Text::WrapI18N')); + eval 'use Locale::Po4a::Common'; + } +} use Locale::Po4a::Chooser; use Locale::Po4a::Po; use File::Basename; -- cgit v1.2.3