require_once("include/oembed.php");
require_once('include/event.php');
+function bb_cleanstyle($st) {
+ return "<span style=\"".cleancss($st[1]).";\">".$st[2]."</span>";
+}
+
+function bb_cleanclass($st) {
+ return "<span class=\"".cleancss($st[1])."\">".$st[2]."</span>";
+}
+
function cleancss($input) {
$cleaned = "";
$Text = str_replace("[*]", "<li>", $Text);
// Check for style sheet commands
- $Text = preg_replace("(\[style=(.*?)\](.*?)\[\/style\])ism","<span style=\"$1;\">$2</span>",$Text);
+ $Text = preg_replace_callback("(\[style=(.*?)\](.*?)\[\/style\])ism","bb_cleanstyle",$Text);
// Check for CSS classes
- $Text = preg_replace("(\[class=(.*?)\](.*?)\[\/class\])ism","<span class=\"$1\">$2</span>",$Text);
+ $Text = preg_replace_callback("(\[class=(.*?)\](.*?)\[\/class\])ism","bb_cleanclass",$Text);
// handle nested lists
$endlessloop = 0;