auge8472 / My-Little-Forum-1

My Little Forum 1 is a thread based forum with additional board and nested views
GNU General Public License v2.0
6 stars 2 forks source link

Decoding [img] BBCode for mail #56

Open bttrx opened 4 years ago

bttrx commented 4 years ago

mlf 1.x (at least 1.7.6 to 1.7.11) does not strip the BBCode tags [img] and [/img] from the mail body. Problem seems to be in function unbbcode() in file functions.php. I guess, it is because no variable $bbcode_img exists somewhere else in mlf source code.

bttrx commented 4 years ago

(I hate GitHub web interface for being so limited in Firefox 52.x: No edit, no preview, ...)

auge8472 commented 4 years ago

After searching myself for $bbcode_img I came to the same conclusion. The variable name exists only in this one function but nowhere else in the whole project. And even if the variable would exist anywhere else, it' value would not exist inside the function because it is neither globalised nor given as a function parameter.

So I would tend to change the if-statement to if ($settings['bbcode_img'] == 1). Any thoughts

bttrx commented 4 years ago

I looked over my old mlf versions. $bbcode_img is a remaining from v1.3 (!), where mlf stores all settings in settings.php. Back then $bbcode_img existed as a global variable. So, yes, please change it.

bttrx commented 3 years ago

Worked for me in 1.7.11. But looks a bit awkward to have, e.g., "img/uploaded/image81.png" written in the mail for relative paths. Maybe this should be expanded by adding the forum's URL (+ "/img/uploaded/") from the "Link to the entry" statement already in the mail.