The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
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);
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|