X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0293ae8e3d8e7dfd0a92bf20aa4c3d28e2d78ddb..11fc28970b329334d88d3667e5b55e0d57e353ab:/IkiWiki/Setup/Automator.pm 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}) {