Bug Profileblock Execution Timeout on large liked posts with many bbcode

Status
Not open for further replies.

Zambfd

Customer
Hi,

Location
File: /dbtech/thanks/includes/class_profileblock.php
Line: 305
Code:
strip_bbcode(strip_tags($results_r['pagetext']))

Problem
If a liked post consists of hundreds of nested bbcodes profiles run into a timeout - especially if the post is liked multiple times.
It happens because of the use of strip_bbcodes on the mentioned line.

So i added a method called strip_bbcode to vB_ProfileBlock_APTL_Thanks in class_profileblock.php.

Code:
    function strip_bbcode( $sText = '') {
        return preg_replace('|[[\/\!]*?[^\[\]]*?]|si', '', $sText);
    }

The new call on line 305 is now:
Code:
strip_bbcode($this->strip_tags($results_r['pagetext']))

It is way faster than using the original strip_bbcode() function of vbulletin in this section.

Regards
 
The use case you describe is not something we have ever encountered in the 5+ years this product has been on the market. I'm reluctant to throw away 5+ years worth of testing that demonstrates the existing code works, vs implementing your change that could very well cause problems.

I'm going to mark this as not a bug, and I'd urge you to back up your changes in case a future version overwrites your changes.
 
Oh, no Problem. Let me attach an example, like it multiple times and you will encounter the problem.
 
I am not saying that I do not believe you, I do apologise if I gave you the impression I believed the issue did not exist.

What I meant to say was that I have never seen a post like that before on any other forum, and no-one else has reported any issues similar to this in the past. In other words, it seems like this issue is largely unique to your forum, as no other forum appears to have such large posts with so many BBCode tags as your forum.

If I was to change the BBCode stripper to your code, the issue on your forum will be fixed for you, but it could cause unexpected and unintentional behaviour for other people. I would be stuck providing support for code I did not write, potentially working around problems that do not occur on your forum, but would occur for others.

I hope that clarified my position. If this becomes a widespread issue, it's something I would revisit. For the time being, however, I would ask that you maintain this change on your own forum rather than expect it to be added to the core product.
 
You just strip the code and do a kind of excerpt for the post preview. And it is only used in the profile block area. My code will work for every situation.
The original strip_bbcode function is way to slow for this kind of multiple massiv parsing on one site/block/tab.
 
Last edited:
Hello Zambfd,

This ticket has now been closed with the status Not A Bug.

We hope your issue or question has been addressed to your satisfaction. If not, please feel free to re-open it by clicking this link.

If you have any further issues or questions, please feel free to start a new support ticket via the button at the top of every page.

Thank you!
 
Status
Not open for further replies.

Legacy Advanced Post Thanks / Like

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,033
Customer rating
5.00 star(s) 1 ratings
Back
Top