X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0293ae8e3d8e7dfd0a92bf20aa4c3d28e2d78ddb..f7601954a862afd4c5a5b9ba83480af0472e1cf9:/IkiWiki/Setup/Automator.pm?ds=inline diff --git a/IkiWiki/Setup/Automator.pm b/IkiWiki/Setup/Automator.pm index 742d67666..d1594d7ea 100644 --- a/IkiWiki/Setup/Automator.pm +++ b/IkiWiki/Setup/Automator.pm @@ -24,15 +24,20 @@ sub prettydir ($) { return $dir; } -sub import (@) { - my $this=shift; - IkiWiki::Setup::merge({@_}); +sub sanitize_wikiname ($) { + my $wikiname=shift; # Sanitize this to avoid problimatic directory names. - $config{wikiname}=~s/[^-A-Za-z0-9_]//g; - if (! length $config{wikiname}) { + $wikiname=~s/[^-A-Za-z0-9_]//g; + if (! length $wikiname) { error gettext("you must enter a wikiname (that contains alphanumerics)"); } + return $wikiname; +} + +sub import (@) { + my $this=shift; + IkiWiki::Setup::merge({@_}); # Avoid overwriting any existing files. foreach my $key (qw{srcdir destdir repository dumpsetup}) {