]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
inline: Prevent creating a file named ".mdwn" when the postform is submitted with...
authorJoey Hess <joeyh@joeyh.name>
Wed, 21 Sep 2016 17:51:42 +0000 (13:51 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 21 Sep 2016 17:51:42 +0000 (13:51 -0400)
IkiWiki/Plugin/inline.pm
debian/changelog
doc/bugs/inline_postform_empty_title.mdwn

index 19dd684dda4bebd8635d18309139fec2ab4fa795..a85cd5d2f5f6ec09967a351edb9e54cd0610e9fa 100644 (file)
@@ -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="";
index 1fed2c09696e1e460f6091a61bbc77b1a7b4f078..ec15142b48019b67cf55457b16267fb0edc478a5 100644 (file)
@@ -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 ]
index 4de08af86fb35a3f53b1869b67a7625ff7b277f8..5fa6102851193001648dcb6cf5a368eb7eb0ae09 100644 (file)
@@ -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.