folderblog
What is folderblog?
Folderblog is a free PHP script that automatically displays the images placed in a given directory, no database needed. It can be used as a blog or gallery — and anything in between.

» demo blog   » learn more   » download now

Discussion
Interesting validation error(back to index)
I've just noticed that, when served as application/xhtml+xml (rather than text/html), FB3 no longer validates, because it injects 9 bytes of garbage data in it's evaluated output. I've no idea when this crept in there, or what those 9 bytes are (they look like ), but some of this can be trimmed away with PHP's trim() function, like this:

eval('?>' . str_replace(array_keys($tags), $tags, trim(file_get_contents(),"")) . '<?php ');

These 9 bytes of data are injected before the
The technical upshot of this is that if you want to properly serve FB3 with the corrent MIME type, it won't validate (though it will still parse correctly and run).

Odd.
posted by Elwing on 14 Jul 05 at 8:51 PM
Darn it. That should read "before the <head> statement and after the <html> statement" and obviously that "file_get_contents()" bit should include 'template_file' with a '$' on the front.

Oh, and Dreamweaver thinks that  is whitespace, but the trim() function won't strip it by default.
posted by Elwing on 14 Jul 05 at 8:57 PM
Post a Reply:

Name:    Remember me
URL:    
(include http:// or mailto:)
(back to index)