X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/dc966032129e07b9a6002a97bc9e6b86c712b4d2..46f8f72793e23b56d3deb1ed0ed6b1a0fbd56ad6:/doc/bugs/filecheck_failing_to_find_files.mdwn diff --git a/doc/bugs/filecheck_failing_to_find_files.mdwn b/doc/bugs/filecheck_failing_to_find_files.mdwn index 95ea5c763..be6cdbb20 100644 --- a/doc/bugs/filecheck_failing_to_find_files.mdwn +++ b/doc/bugs/filecheck_failing_to_find_files.mdwn @@ -2,6 +2,14 @@ Using the attachment plugin, when filecheck was checking the mime-type of the at It turns out that the filecheck plugin couldn't find the file, because it was merely using the $pagesources hash, rather than finding the absolute path of the file in question. +> I don't understand why the file was not in `%pagesources`. Do you? +> --[[Joey]] + +>> The file *was* in `%pagesources`, but what returns from that is the filename relative to the `srcdir` directory; for example, `foo/bar.gif`. +>> When File::MimeInfo::Magic::magic is given that, it can't find the file. +>> But if it is given `/path/to/srcdir/foo/bar.gif` instead, then it *can* find the file, and returns the mime-type correctly. +>> --[[KathrynAndersen]] + The following patch fixes the problem: diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm @@ -19,5 +27,3 @@ The following patch fixes the problem: # Use ::magic to get the mime type, the idea is to only trust # data obtained by examining the actual file contents. - -[[!tag patch]]