php forum
php mysql forum
php mysql smarty
 
Topic Options
#317183 - 06/09/08 09:01 AM [7.3] Dissallow quotes more then 3 levels deep
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
UBB 7.3 kinda has a bug that I was happy with, you can't quote so deep.

I made some code that checks for the quote level, and gives an error if you quote more then 3 levels deep.

open /scripts/addpost.inc.php

find:
Code:
	// -------------------------------------
	// Make sure there is a subject and body


add above:

Code:
	// ---------------------
	// Check maximum quote level

	unset($total);
	preg_match_all('%(\[quote=.+?\]|\[quote\]|\[/quote\])%', $Body, $result, PREG_PATTERN_ORDER);
	for ($i = 0; $i < count($result[0]); $i++) {
		$total .= $result[0][$i];
	}
	if (preg_match('%(\[/quote\]){4,}%', $total)) {
		$html -> not_right($ubbt_lang['MAX_QUOTE']);
	};


open /languages/english/addpost.php (plus every other language you might have)

find
Code:
$ubbt_lang['VIEW_POST'] = "View your post.";


add below:
Code:
$ubbt_lang['MAX_QUOTE'] = "For readability you can only quote messages 3 levels deep. Please edit your message and try again.";


The 3 levels deep is hardcoded in the regex, so if you want to change it, change the regex.


Edited by blaaskaak (08/01/08 02:33 AM)
Edit Reason: update
_________________________

Top
#317201 - 06/11/08 09:16 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: blaaskaak]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
Interesting smile Does your forum have issues with it? I understand there's a bug, but does your users actually exploit it? smile
_________________________
- Allen wavey
- What Drives You?

Top
#317203 - 06/11/08 10:25 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: AllenAyres]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
Well, issues...

Some users just hit quote, type their reply and that's it. If a couple users do that, imho it looks butt-ugly laugh over 5-6 quotes deep make little to no sense to me conversation wise.

SD can testify that I played with quote in quote regexes before. It's just that UBB's bug sort of made us tell the members "it is forbidden from now on to quote so deep".
_________________________

Top
#317207 - 06/11/08 11:33 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: blaaskaak]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
Understand - I use the quickreply mostly, rarely the quote smile
_________________________
- Allen wavey
- What Drives You?

Top
#317209 - 06/11/08 12:22 PM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: AllenAyres]
sirdude Moderator Offline
Enthusiast

Registered: 11/08/03
Posts: 442
Loc: SoCal
Originally Posted By: AllenAyres
Understand - I use the quickreply mostly, rarely the quote smile


i'm a quick/quote kinda guy.. and we need to fix the quote bug too smile
_________________________

Top
#317472 - 08/01/08 02:35 AM Re: [7.3] Dissallow quotes more then 3 levels deep [Re: sirdude]
blaaskaak Offline
Enthusiast

Registered: 02/25/07
Posts: 304
Loc: The Netherlands
First post is updated, the regex originally posted gave some false positives if you would have 7+ normal quotes in a message.

Thanks to SD for helping thinking this new construction up.
_________________________

Top


Moderator:  sirdude 
Who's Online
0 registered (), 18 Guests and 10 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Wisdom needed
by Gizmo
Yesterday at 10:54 AM
How to hide sub forums from summary page
by blaaskaak
12/03/08 09:54 AM
Spell Check [beta]
by Bill B
12/01/08 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
Truth, David DelMonte, nick1, Begbie, cenk
13364 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438

 

 

 
fusionbb message board php hacks