Don't require closing tag for tags that don't need it.
Don't truncate inside an HTML comment!
Do truncation by actual character count.

Using substr can cut a multi-byte character in half.

Also, if a long post with many multi-byte characters was reported, then
the mod interface would temporarily extend the body_truncate_char
setting to be sure to cover all of the *characters* in the report, but
this function would interpret body_truncate_char as a number of *bytes*,
so sometimes the end of the report's appended html would be cut off.
Merge pull request #91 from Macil/truncfixes

Post Truncation fixes
Remove buildThread() call from mod_deletefile because deleteFile()
already calls it.
Add (`thread`, `id`) multi-column key to optimize rebuilding index pages.

This SQL command can be used to add the key to existing board tables:
create index `thread_id` on posts_%s (`thread`, `id`);
Add image_reject_repost_in_thread option
Don't do anything if a mod link is middle-clicked.

This lets Chrome users open mod actions in a new tab by middle-clicking,
as Chrome still calls the onclick event when middle-clicking unlike
Firefox.
Global missing from mod_logout
Fix incorrect log message when bumplocking and stickying threads.
Handle posts without filenames.

If a post doesn't have a filename (such as because of a post event
changing it), then don't show an empty filename with the post.
Removed redundant code in image processing.

Both paths of the code here did the same thing.
Extend timelimit when rebuilding from mod interface.

The rebuild_timelimit config option was not used anywhere since the mod
interface rewrite.
Made deleting posts by IP more efficient.

No longer rebuilds same thread multiple times.
Insert into posts table using named columns.

Makes it easier to update the posts table schema.
Fix transforming links to mod links in OP posts.

Similar regexes are called for threads and posts, but they differed
needlessly, and the thread regex would drop anything between the `<a`
and `href="` parts. This makes them both the same and functional.
Incorrect parameter type.

The parameter was bound with the wrong type. I guess the type isn't
enforced judging by how the code still seemed to work, but it probably
should be fixed.
Merge pull request #92 from Macil/fixes

Miscellaneous bugfixes
Merge pull request #93 from Macil/image_reject_repost_in_thread

Add image_reject_repost_in_thread option
Remove now redundant single-column `thread` key from posts_* tables.