Jan's Markdown Preview

Julian 'Julik' Tarkhanov listbox at julik.nl
Wed Dec 7 13:14:47 EST 2005



On 7-dec-2005, at 14:09, Michel Fortin wrote:


> Le 2005-12-07 à 05:42, Julian 'Julik' Tarkhanov a écrit :

>

>> <?php

>> include_once 'markdown.php';

>> ob_start('markdown');

>> include($somehow_deducted_path_to_markdown_document);

>> ob_end_flush();

>> ?>

>

> Be very careful with that as it will execute any PHP instruction

> found in the Markdown-formatted document. If that's what you want,

> fine; otherwise:

>

> <?php

> include_once 'markdown.php';

> $body = Markdown(file_get_contents($path_to_markdown_file));

> ?>


Michel is right, but this was intentional (it allows me to mixmash
Markdown and code that does nice things to the document) - but if you
need it to be secure you indeed better use conventional read procedure.


--
Julian 'Julik' Tarkhanov
me at julik.nl





More information about the Markdown-Discuss mailing list