<?php
/*
Simple:Press Forum
rte(tm) to xhtml parser
$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_RTE2Html($text)
{
	$text = trim($text);

	# RTE-TM-Code
	if (!function_exists('rtetohtml_escape')) {
		function rtetohtml_escape($s) {
			global $text;
			return '<div class="sfcode">'.str_replace('"', '&quot;', $s[1]).'</div>';
		}
	}
	$text = preg_replace_callback('/\<div class=\"sfcode\"\>(.*?)\<\/div\>/ms', "rtetohtml_escape", $text);

	return $text;
}

?>