diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-07-22 17:38:31 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-07-22 17:38:31 -0400 |
commit | 89b3bb7e38ffd78a4e3b3609c685a23a431f1be5 (patch) | |
tree | 38af4e2de3f66b154a15e60167fca336aff97317 /IkiWiki/Plugin | |
parent | 9776bbf8532d0a952e907c160dc31ce27c0d08e5 (diff) |
check for absolute paths
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r-- | IkiWiki/Plugin/rename.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm index fd0bd3ae8..126c7ba13 100644 --- a/IkiWiki/Plugin/rename.pm +++ b/IkiWiki/Plugin/rename.pm @@ -47,8 +47,9 @@ sub check_canrename ($$$$$$$) { #{{{ error(gettext("no change to the file name was specified")); } - # Must be a legal filename. - if (IkiWiki::file_pruned($destfile, $config{srcdir})) { + # Must be a legal filename, and not absolute. + if (IkiWiki::file_pruned($destfile, $config{srcdir}) || + $destfile=~/^\//) { error(sprintf(gettext("illegal name"))); } |