summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-01-16 14:29:46 +0100
committerintrigeri <intrigeri@boum.org>2009-01-16 15:07:05 +0100
commitdf82b5e62a1066752d9260728485772dbafae8c5 (patch)
treeb5eceaed91189efaa3a53df20093bed37c79d8bf
parent1c53179e978380d7447f6e5f9a8f4d69f88a854a (diff)
po: when possible, disable use of Text::WrapI18N in po4a; else warn about too old po4a
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r--IkiWiki/Plugin/po.pm10
-rw-r--r--doc/plugins/po.mdwn7
2 files changed, 12 insertions, 5 deletions
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;
diff --git a/doc/plugins/po.mdwn b/doc/plugins/po.mdwn
index 92fba349f..5c98f3485 100644
--- a/doc/plugins/po.mdwn
+++ b/doc/plugins/po.mdwn
@@ -333,11 +333,8 @@ means the `Text` module only.
[Debian bug #470250](http://bugs.debian.org/470250)), but it is
optional and we do not need the features it provides.
-> I proposed a patch based on Joey's to po4a-devel, allowing to fully
-> disable this module's use. When it is merged upstream, we'll need to add
-> `use Locale::Po4a::Common qw(nowrapi18n)` to `po.pm`, before loading
-> any other `Locale::Po4a` module. A versioned dependency may be needed.
-> --[[intrigeri]]
+> If a recent enough po4a is installed, this module's use is fully disabled.
+> This feature has been merged in po4a CVS on 2009-01-15. --[[intrigeri]]
##### Term::ReadKey