MyBB Hacks

Full Version: Help with inserting 3 lines of code into pm datahandler
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello.

I am attempting to insert 3 lines of code into inc/datahandlers/pm.php of MyBB 1.8

Essentially I maintain the Steam Login Plugin. As seen at https://github.com/noxwyll/Steam-Login-MyBB-1.8

The plugin allows among other things allows users to use unicode signs [like 🍰] in their username (this is in parts based on the display-names plugin).

However this leads to an issue in PM Validation as MyBB does now know how to deal with the special chars and as such MySQL will say the recipients do not exist.

To resolve this I need to run 3 lines of code in this file at a very specific point.

However this means having the users alter a stock mybb file which is not preferable.

So does anyone have an idea how to get my code at the place I need it?

My code is

PHP Code:
require_once MYBB_ROOT.'inc/class_steam.php';
$steamhandler = new steam;
foreach($pm[$recipient_type] as &$row) $row = $steamhandler->steam_unicode_username($row);


Which needs to be at line 190 before

PHP Code:
$recipientUsernames = array_map(array($db, 'escape_string'), $pm[$recipient_type]);

in order for PMs to pass validation and for the pm to be sent correctly to the recipients.

Solved. Approached this on a higher level.
Reference URL's