]> sipb.mit.edu Git - ikiwiki.git/commitdiff
inline: Allow direct inclusion of non-page files in raw mode.
authorJoey Hess <joey@gnu.kitenet.net>
Fri, 13 Nov 2009 20:10:58 +0000 (15:10 -0500)
committerJoey Hess <joey@gnu.kitenet.net>
Fri, 13 Nov 2009 20:10:58 +0000 (15:10 -0500)
IkiWiki/Plugin/inline.pm
debian/changelog
doc/bugs/inline_raw_broken_on_unknown_pagetype.mdwn

index 001d2ed1a103618717b31d11a3553c0dab72cbf0..8e7fa99580b4416adb78ebb3d676bfb80b5a78e2 100644 (file)
@@ -337,7 +337,7 @@ sub preprocess_inline (@) {
                foreach my $page (@list) {
                        my $file = $pagesources{$page};
                        my $type = pagetype($file);
-                       if (! $raw || ($raw && ! defined $type)) {
+                       if (! $raw) {
                                if ($needcontent) {
                                        # Get the content before populating the
                                        # template, since getting the content uses
@@ -391,6 +391,10 @@ sub preprocess_inline (@) {
                                              filter($page, $params{destpage},
                                              readfile(srcfile($file)))));
                                }
+                               else {
+                                       $ret.="\n".
+                                             readfile(srcfile($file));
+                               }
                        }
                }
        }
index 5a2d94e232020036386a77cf0232c9506cc73499..b25651f42a700dc39cfd55e5b24de9e0691ce37b 100644 (file)
@@ -14,6 +14,7 @@ ikiwiki (3.20091032) UNRELEASED; urgency=low
     only when ikiwiki needs authentication, rather than for any access to 
     the cgi/wiki.
   * inline: Do not generated feeds for nested inlines.
+  * inline: Allow direct inclusion of non-page files in raw mode.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 06 Nov 2009 12:04:29 -0500
 
index 814074e0822346468abb3d0a3921bb139d05b85c..e43540c657fe7f601ec99013cf0ecd126dff8ebe 100644 (file)
@@ -17,3 +17,11 @@ this situation.
 
 If we explicitely don't want to allow raw inlining of unknown page
 types, ikiwiki should output a better error message.
+
+> I have made it just do a direct include if the page type is not known, in
+> raw mode. That seems useful if you want to include some other file right
+> into a page. You could probably even wrap it in a format directive.
+> 
+> It does allow including binary files right into a page, but nothing is
+> stopping you pasting binary data right into the edit form either, so
+> while annoying I don't think that will be a security problem. --[[Joey]]