savetheinternet / Tinyboard

The better imageboard software
http://tinyboard.org
Other
368 stars 311 forks source link

Severe regression: $post['body_nomarkup'] is empty as of commit 461084d4 #126

Closed ctrlcctrlv closed 11 years ago

ctrlcctrlv commented 11 years ago

Steps to reproduce:

1) Have a MySQL version that will use the code

$post['body_nomarkup'] = preg_replace('/[\x{010000}-\x{ffffff}]/u', '', $post['body']);

or be using Tinyboard updated to commit 461084d4.

2) Make ANY post. 3) PHP masks the following error, and inserts AN EMPTY STRING into $post['body_nomarkup']:

Warning: preg_replace(): Compilation failed: character value in \x{...} sequence is too large at offset 21 in /srv/www/wizardchan.org/public_html/post.php on line 381

If you attempt to edit a post or move a thread or anything that uses nomarkup, it WILL NOT WORK. Additionally, NULL values are inserted into the database on every post.

This change has hosed my database. For the mean time I am upgrading to the latest version which uses utf8mb4 but this will still break ALL Tinyboard versions with an old version of MySQL if they attempt to rebuild posts, move posts, edit posts, and other things I probably don't know that cause no_markup to be referred to.

savetheinternet commented 11 years ago

This bug only affected some PHP builds, not all. I'm not sure which version or CPU architecture, etc. it was present in and I'm not going to try to find out. It's been resolved.