ikiwiki/doc
Joey Hess 716560b7f1 check for invalid utf-8, and toss it back to avoid crashes
Since ikiwiki uses open :utf8, perl assumes that files contain valid utf-8.
If it turns out to be malformed it may later crash while processing strings
read from them, with 'Malformed UTF-8 character (fatal)'.

As at least a quick fix, use utf8::valid as soon as data is read, and if
it's not valid, call encode_utf8 on the string, thus clearing the utf-8
flag. This may cause follow-on encoding problems, but will avoid this
crash, and the input file was broken anyway, so GIGO is a reasonable
response. (I looked at calling decode_utf8 after, but it seemed to cause
more trouble than it was worth. BTW, use open ':encoding(utf8)' avaoids
this problem, but the corrupted data later causes Storable to crash when
writing the index.)

This is a quick fix, clearly imperfect:
- It might be better to explicitly call decode_utf8 when reading files,
  rather than using the IO layer.
- Data read other than by readfile() can still sneak in bad utf-8. While
  ikiwiki does very little file input not using it, stdin for the CGI
  would be one way.
2008-11-12 17:30:54 -05:00
..
banned_users
basewiki fix up some links 2007-12-08 20:04:18 -05:00
bugs pagetitle vs meta: announcing a working prototype 2008-11-12 01:10:09 +01:00
cgi web commit by http://jcflack.myopenid.com/ 2008-07-09 08:24:14 -04:00
contact web commit by http://madduck.net/ 2008-03-10 09:42:37 -04:00
css_market add 2008-08-21 22:23:28 -04:00
examples remove post, since this is intended to be an example people copy and use, 2008-10-06 12:53:55 -04:00
forum Fix reference link 2008-11-04 11:19:14 -05:00
ikiwiki reorg to avoid broken link in basewiki 2008-11-10 17:40:03 -05:00
ikiwiki-mass-rebuild
ikiwikiusers
index pull together info on converting to ikiwiki from other systems 2008-10-20 16:55:38 -04:00
install response 2008-10-20 10:38:39 -04:00
logo
news add news item for ikiwiki 2.69 2008-11-11 21:07:06 -05:00
plugins response 2008-11-11 18:34:18 -05:00
post-commit response 2008-07-16 17:52:13 -04:00
rcs Note unimplemented features 2008-10-27 22:33:20 -04:00
roadmap
sandbox Only a simple test 2008-10-14 04:04:33 -04:00
security copying an intersting bit from an email I'm writing 2008-01-30 16:30:24 -05:00
setup 2008-09-05 06:55:18 -04:00
smileys
soc Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
tags Migrate escaped directives (\[[) in the rest of doc to have \[[! prefix 2008-07-21 12:47:07 +01:00
templates response 2008-09-17 13:45:57 -04:00
tips document other files in .ikiwiki 2008-11-11 21:01:16 -05:00
todo lockwiki changes 2008-11-11 15:54:52 -05:00
translation
usage web commit by JeremyReed: Need to add to man page? 2008-01-16 11:08:47 -05:00
users add item to watch list 2008-11-11 07:59:06 -05:00
w3mmode remove ikiwiki.setup 2008-07-26 22:55:39 -04:00
wikiicons Added a small icon to the search input box. 2008-08-06 19:34:33 -04:00
GPL
TourBusStop.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
backlinks.mdwn
banned_users.mdwn banned_users move to setup file, stage 1 2008-08-01 17:39:17 -04:00
basewiki.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
blog.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
bugs.mdwn remove test 2008-07-21 17:18:14 -04:00
cgi.mdwn added configuration for recentchanges 2008-01-29 15:51:32 -05:00
commit-internals.mdwn
consultants.mdwn add consultant list, add news item 2008-06-12 16:34:18 -04:00
contact.mdwn add a link to the forum 2008-05-15 17:00:05 -04:00
convert.mdwn pull together info on converting to ikiwiki from other systems 2008-10-20 16:55:38 -04:00
css.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
css_market.mdwn Adding two CSS / themes 2008-09-22 10:31:21 -04:00
download.mdwn randomly stumbled over fedora packages of ikiwiki 2008-10-20 20:34:29 -04:00
examples.mdwn add link to css market 2008-06-02 17:46:52 -04:00
favicon.ico
features.mdwn update 2008-10-08 18:02:03 -04:00
forum.mdwn turn on archive mode for forum 2008-10-20 15:38:17 -04:00
freesoftware.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
git.mdwn mention twitter feed 2008-10-24 17:50:14 -04:00
ikiwiki-makerepo.mdwn monotone updates 2008-08-22 00:22:02 -04:00
ikiwiki-mass-rebuild.mdwn
ikiwiki-transition.mdwn add ikiwiki-transition setupformat subcommand. 2008-08-05 20:40:49 -04:00
ikiwiki-update-wikilist.mdwn ikiwiki-update-wikilist: Add -r switch to remove. Default behavior is now always to add. 2008-07-27 00:02:04 -04:00
ikiwiki.mdwn reorder 2008-09-12 16:12:37 -04:00
ikiwikiusers.mdwn 2008-10-30 05:34:13 -04:00
index.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
install.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
local.css
logo.mdwn correct the command line used to generate the favicon 2008-04-10 18:51:21 -04:00
news.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
pagehistory.mdwn
patch.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
plugins.mdwn Sort plugins by title. 2008-08-06 23:09:08 -04:00
post-commit.mdwn Word-wrap post-commit page 2008-01-28 00:39:17 -08:00
rcs.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
recentchanges.mdwn test for meta plugin and don't use when not available 2008-07-17 00:32:46 -04:00
roadmap.mdwn analysis of most used non-exported library functions by plugins 2008-09-27 13:39:56 -04:00
robots.txt add a robots.txt 2008-11-10 18:08:09 -05:00
sandbox.mdwn make sure web edits still work :-) 2008-10-24 15:50:58 -04:00
security.mdwn check for invalid utf-8, and toss it back to avoid crashes 2008-11-12 17:30:54 -05:00
setup.mdwn typo 2008-09-15 11:32:36 -04:00
shortcuts.mdwn fix entry 2008-10-11 10:29:52 -04:00
sitemap.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
smileys.mdwn add smiley to work around markdown 2008-07-17 13:03:00 -04:00
soc.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
style.css add padding between inlined page title and content 2008-10-01 16:49:56 -04:00
tags.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
templates.mdwn fix links 2008-09-14 17:01:05 -04:00
tipjar.mdwn thanks, pawel 2008-07-12 10:17:25 -04:00
tips.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
todo.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
translation.mdwn
usage.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
users.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00
w3mmode.mdwn
whyikiwiki.mdwn
wikitemplates.mdwn move inline docs to ikiwiki/directive/inline 2008-09-11 19:39:35 -04:00
wishlist.mdwn Migrate everything else via prefix_directives 2008-07-21 12:32:31 +01:00