Help with inserting 3 lines of code into pm datahandler
Tatsuto Offline
Junior Member
**
Posts: 3
Joined: Apr 2017
Post: #1
Help with inserting 3 lines of code into pm datahandler
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.

(This post was last modified: 04-16-2017 05:16 AM by Tatsuto.)
04-16-2017 05:15 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Help with inserting 3 lines of code into pm datahandler - Tatsuto - 04-16-2017 05:15 AM

 Standard Tools
Forum Jump: