defendtheweb / hackthis.co.uk

HackThis!!
http://www.hackthis.co.uk
Other
46 stars 55 forks source link

Possible fix for huge code blocks #143

Closed SeinopSys closed 10 years ago

SeinopSys commented 10 years ago

I'd like to propose a fix for issue #142, but unfortunately I don't have access to a local web server currently, so this has NOT been tested, and should be locally tested before merging.

The modified PHP code is supposed to remove excess <br> tags from the generated html of the bbcode tag. I added it based on this documentation

Expected result of the fix:

lwward commented 10 years ago

Could we move the $this->bbcode->AddRule into files/vendor/nbbc.php I know that file is a bit of a behemoth but it would keep the app class tidier.

SeinopSys commented 10 years ago

The thing is, the doc says this is where it should be added

lwward commented 10 years ago

In that case then maybe we should think of moving it somewhere else, even if it's just a function inside the App class.

SeinopSys commented 10 years ago

It has to be somewhere between the place the variable is created from the class and the place where the bbcode related methods are called. It could be moved to the place where the messages are displayed, but that would require adding it to at least 2 places, the personal messages and the forum.

lwward commented 10 years ago

I was thinking of something as simple as the connectDB call, just so the construct doesn't get messy.

SeinopSys commented 10 years ago

@0x6C77 Pushed a commit to do just that.

lwward commented 10 years ago

Awesome, thank you :)

lwward commented 10 years ago

It turns out you can't use template and function in the same tag. So I moved the template into the function and everything worked perfectly. Thank you :+1: