aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-21 13:51:42 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-21 13:51:42 -0400
commit68e23206961862a2b05f99ea0bbe82fe28e21367 (patch)
tree4144177b85738b5b585f43819c4a6861da96e193
parent8a638d6b53b5d289c1a233ed3ef2dc0a58fe4369 (diff)
downloadikiwiki-68e23206961862a2b05f99ea0bbe82fe28e21367.tar
ikiwiki-68e23206961862a2b05f99ea0bbe82fe28e21367.tar.gz
inline: Prevent creating a file named ".mdwn" when the postform is submitted with an empty title.
-rw-r--r--IkiWiki/Plugin/inline.pm3
-rw-r--r--debian/changelog7
-rw-r--r--doc/bugs/inline_postform_empty_title.mdwn4
3 files changed, 13 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/inline.pm b/IkiWiki/Plugin/inline.pm
index 19dd684dd..a85cd5d2f 100644
--- a/IkiWiki/Plugin/inline.pm
+++ b/IkiWiki/Plugin/inline.pm
@@ -121,6 +121,9 @@ sub sessioncgi ($$) {
if ($q->param('do') eq 'blog') {
my $page=titlepage(decode_utf8(scalar $q->param('title')));
$page=~s/(\/)/"__".ord($1)."__"/eg; # don't create subdirs
+ if (! length $page) {
+ error(gettext("please enter a page title"));
+ }
# if the page already exists, munge it to be unique
my $from=$q->param('from');
my $add="";
diff --git a/debian/changelog b/debian/changelog
index 1fed2c096..ec15142b4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ikiwiki (3.20160906) UNRELEASED; urgency=medium
+
+ * inline: Prevent creating a file named ".mdwn" when the
+ postform is submitted with an empty title.
+
+ -- Joey Hess <id@joeyh.name> Wed, 21 Sep 2016 13:48:32 -0400
+
ikiwiki (3.20160905) unstable; urgency=medium
[ Joey Hess ]
diff --git a/doc/bugs/inline_postform_empty_title.mdwn b/doc/bugs/inline_postform_empty_title.mdwn
index 4de08af86..5fa610285 100644
--- a/doc/bugs/inline_postform_empty_title.mdwn
+++ b/doc/bugs/inline_postform_empty_title.mdwn
@@ -1,4 +1,6 @@
When using inline with postform=yes, the user can click on the edit button
without providing a title, and are allowed to save the page. This results
in a file with a name like ".mdwn", which ikiwiki won't render.
--[[Joey]]
+--[[Joey]]
+
+> [[done]]; made it error out in this case.