|
@@ -232,6 +232,11 @@ function preparsecode(&$message, $previewing = false)
|
|
|
// Close any remaining table tags.
|
|
|
foreach ($table_array as $tag)
|
|
|
$parts[$i] .= '[/' . $tag . ']';
|
|
|
+
|
|
|
+ // Remove empty bbc from the sections outside the code tags
|
|
|
+ $parts[$i] = preg_replace('~\[[bisu]\]\s*\[/[bisu]\]~', '', $parts[$i]);
|
|
|
+ $parts[$i] = preg_replace('~\[quote\]\s*\[/quote\]~', '', $parts[$i]);
|
|
|
+ $parts[$i] = preg_replace('~\[color=(?:#[\da-fA-F]{3}|#[\da-fA-F]{6}|[A-Za-z]{1,20}|rgb\(\d{1,3}, ?\d{1,3}, ?\d{1,3}\))\]\s*\[/color\]~', '', $parts[$i]);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -243,10 +248,6 @@ function preparsecode(&$message, $previewing = false)
|
|
|
|
|
|
// Now let's quickly clean up things that will slow our parser (which are common in posted code.)
|
|
|
$message = strtr($message, array('[]' => '[]', '['' => '[''));
|
|
|
-
|
|
|
- // Remove empty bbc.
|
|
|
- $message = preg_replace('~\[[bisu]\]\s*\[/[bisu]\]~', '', $message);
|
|
|
- $message = preg_replace('~\[quote\]\s*\[/quote\]~', '', $message);
|
|
|
}
|
|
|
|
|
|
/**
|