<?php
/*
Simple:Press Forum
raw html to xhtml parser (just looking for 'code' blocks
$LastChangedDate: 2009-02-13 20:15:10 +0000 (Fri, 13 Feb 2009) $
$Rev: 1384 $
*/

if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) {
	die('Access Denied');
}

function sf_Raw2Html($text)
{
	$text = trim($text);

	if (!function_exists('rawtohtml_escape')) {
		function rawtohtml_escape($s) {
			global $text;
			return '<code>'.htmlspecialchars($s[1]).'</code>';
		}
	}
	$text = preg_replace_callback('/\<code\>(.*?)\<\/code\>/ms', "rawtohtml_escape", $text);

	return $text;
}

?>