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 34 forks source link

Retrieved binary field isn't properly unescaped when merge a MyBB database #277

Closed yuliu closed 2 years ago

yuliu commented 2 years ago

For example, merging a MyBB on a PostgreSQL database to a MySQL database, the users and posts modules would have the SQL errors of regip, lastip, ipaddress (the column name) is too long.

Those binary fields need to be unescaped before sending to the be converted so that they'll get properly escaped.

// users module
$insert_data['regip'] = $this->old_db->unescape_binary($data['regip']);
$insert_data['lastip'] = $this->old_db->unescape_binary($data['lastip']);

// posts module
$insert_data['ipaddress'] = $this->old_db->unescape_binary($data['ipaddress']);

// pollvotes module
$insert_data['ipaddress'] = $this->old_db->unescape_binary($data['ipaddress']);

// privatemessages module
$insert_data['ipaddress'] = $this->old_db->unescape_binary($data['ipaddress']);