mybb / merge-system

The MyBB Merge System allows for easy merging of an existing forum (be it MyBB or another forum software) into a MyBB 1.8.x forum.
Other
34 stars 33 forks source link

Smilies #172

Open JN-Jones opened 9 years ago

JN-Jones commented 9 years ago

phpBB saves smilies in an odd way so they can't be merged automatically.

JN-Jones commented 9 years ago

Apparently other boards save the smiley path too instead of the simple smiley: http://community.mybb.com/thread-172167.html

ghost commented 9 years ago

I added those lines to boards\phpbb3\posts.php seems to work pretty well :smile:

$insert_data['message'] = preg_replace('/<!--[\s\S].+alt="/', '', $insert_data['message']); $insert_data['message'] = preg_replace('/" title=[\s\S].+-->/', '', $insert_data['message']);

JN-Jones commented 9 years ago

That's definitely not the correct solution. First of all those regex should be added to the bbparser file (otherwise eg PMs aren't parsed). And secondly you simply remove every piece of text which looks like a comment. Eg:

This is the starting code for HTML comments: <!--. (long explanation about image tags or whatever) An alternative text can be added via alt="whatever".

Your regex would react on that message. Same for the second one.