MyBB Community Forums

Full Version: class_parser:parse_smilies - bug or my fault ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
on my site and on fresh mybb installation I found that urls like

[url=community.mybb.com]multiline
url
content
[/url]

are not shown by showthread.php. on generated page there is <mybb-bad-sm> code instead of url.

I think that this is by different regexes used in function parse_smilies
// First we take out any of the tags we don't want parsed between (url= etc)
preg_match_all( "#\[(url(=[^\]]*)?\](.*?)\[\/url\]|quote=([^\]]*)?\])#i", $message, $bad_matches, PREG_PATTERN_ORDER);
$message = preg_replace( "#\[(url(=[^\]]*)?\](.*?)\[\/url\]|quote=([^\]]*)?\])#si", "<mybb-bad-sm>",$message);

preg_match_all matches not a multiline content, but preg_replace matches multiline content.

when I add 's' to preg_match_all regex - everything work fine.
That's why I believe that this is a bug.

However it works fine here (community.mybb.com)
i.e. multiline
url
content

and in source repository there is still no 's'.
(look repository line 437)

That's way I suspect that it is some misconfiguration somewhere in my server or in mybb.

Can somebody clear it up for me Wink

my test environment with fresh installation of MyBB:
MyBB Version 1.6.4
PHP Version  5.3.6-13ubuntu3.2
SQL Engine   MySQLi 5.1.58
also there is a nice side effect of this behavior:

message content
start
1 test
[url]http://1.test.com[/url]
1 multiline
[url=http://1.multiline.com]this is
a 1st multiline url
content
[/url]
2 test
[url]http://2.test.com[/url]
2 multiline
[url=http://2.multiline.com]this is
a 2nd multiline url
content
[/url]
3 test
[url]http://3.test.com[/url]
4 test
[url]http://4.test.com[/url]
1 quote
[quote=quote1]
quote test 1
[/quote]
2 quote
[quote=quote2]
quote test 2
[/quote]
end

then you see it as
[attachment=24697]