I had some performance problems with the strip_bbcode() function in includes/functions.php. I investigated and found that for certain types of content (with lots of bbcodes), the code runs slow and gives bad results.
I made some small tweaks to the regex that improved results. Here is a patch
Code:
--- a/includes/functions.php 2012-09-14 11:11:52.000000000 -0400
+++ b/includes/functions.php 2012-09-14 15:17:39.000000000 -0400
@@ -2313,7 +2313,7 @@
if ($stripimg)
{
- $find[] = '#\[(attach|img|video).*\].+\[\/\\1\]#siU';
+ $find[] = '#\[(attach|img|video)[^\]]*\].+\[\/\\1\]#siU';
$replace[] = '';
}
@@ -2322,7 +2322,7 @@
{
// any old thing in square brackets
- $find[] = '#\[.*/?\]#siU';
+ $find[] = '#\[[^\]]*\]#si';
$replace[] = '';
$message = preg_replace($find, $replace, $message);
Please review, and if it's good, then hopefully vbulletin devs will include this patch in the next release.