More than 51 urls will not parse properly in BBCode
Submitted Tarun, Sep 03 2009 12:59 PM | Last updated Aug 20 2012 05:08 AM
More than 51 urls will not parse properly in BBCode. I made a test post on these forums and saw a similar issue.
http://forums.invisi...-51-urls-parse/
http://forums.invisi...-51-urls-parse/
| Status: | Cannot Reproduce |
| Version: | 3.3.4 |
| Fixed In: | 0 |











30 Comments
Updating severity to: 3 - Medium
I added infinite loop protection, but obviously 50 isn't going to be sufficient.
Need to come up with a number that will be sufficient, while still having the same effect (stop it from having the possibility of looping forever).
As an example.
Maybe this protection could be re-engineered into a BBCode limit option in the ACP, like how there's an emoticon limit.
Maybe set the limit based on the length of the post. A post can't have more than ("length in bytes" / 10) bbcodes, for example. This prevents inifinite loops, but will never not process a code.
//----------------------------------------- // Protect against endless loops //----------------------------------------- static $iteration = array(); if( array_key_exists( $tag, $iteration ) AND $iteration[ $tag ] > 50 ) { return $txt; }If you change '50' to another, larger number, that should help. I make no guarantees that it does, though, since I haven't tested this on my system. Yet...Al
..Al
Thanks, but the number there is already set to 500 (I haven't changed it yet)...
UPDATE: I Changed it to 5000 and it seems to have fixed the issue, at least temporarily. Thanks for the suggestion and help, very much appreciated.
Glad adjusting it worked on your board. I'll be setting it pretty high myself as well (I'm glad I saw this before I upgraded my board to 3.0.3, which I'm working on right now)..
..Al
Al, you were right, and what happened was IPS support changed it to 500 right before I changed it to 5,000. Thanks again for the help, much appreciated.
..Al
Find all references to 50 in the admin/sources/classes/bbcode/core.php file and raise that.. Should be 2..
Then same thing in /admin/sources/classes/bbcode/custom/defaults.php and there's about 6 of them in there.
That really should be a single constant somewhere..
..Al
For the record, that limit is per-bbcode, not global. So you could use 50 bold tags, 50 url tags, etc. but no more. We'll change it higher to prevent the problem in the next release.
It solved my problem
Editing this didn't help:
//----------------------------------------- // Protect against endless loops //----------------------------------------- static $iteration = array(); if( array_key_exists( $tag, $iteration ) AND $iteration[ $tag ] > 50 ) { return $txt; }but editing this one, did:
// Stop infinite loops //----------------------------------------- if( $_iteration > [b]5000[/b] ) { break; }Also the code
// Stop infinite loops //----------------------------------------- if( $_iteration > [b]5000[/b] ) { break; }appears as
// Stop infinite loops //----------------------------------------- if( $_iteration > 50 ) { break; }on mine
But yes, no love for me. Could it be something else? I changed the first file and the other 4 on the other file to 5000 (from the default 50)
Did you change 50 to 5000 and did you SAVE the file after making changes?
Yes they are saved. I use vi in shell to edit so I know its saved
As for what I mean on the "/admin/sources/classes/bbcode/custom/defaults.php" file
it was previously
//----------------------------------------- // Stop infinite loops //----------------------------------------- if( $_iteration > 50 ) { break; }now they all have been changed with 5000
//----------------------------------------- // Stop infinite loops //----------------------------------------- if( $_iteration > 5000 ) { break; }FYI I have IPB 3.0.3
Restart browser.
I have tried doing that (clear cache and reload) on IE, FF and safari and still no love.
Issue fixed in: 3.0.4
Fixed for all BBcodes.
Basically you have to delete the Cache Post which is under System Settings --> Tools and Settings --> Cache Management --> Cached Posts
The board was just caching the problem.