forked from leftypol/leftypol
Upgrade to utf8mb4 charset for MySQL server versions above 5.5.3. Keep support for older versions. Fix charsets for multiple columns and tables.
This commit is contained in:
parent
91bb3182da
commit
8efab06616
6 changed files with 202 additions and 87 deletions
5
post.php
5
post.php
|
@ -378,7 +378,10 @@ if (isset($_POST['delete'])) {
|
|||
|
||||
wordfilters($post['body']);
|
||||
|
||||
$post['body_nomarkup'] = preg_replace('/[\x{010000}-\x{ffffff}]/u', '', $post['body']);
|
||||
if (mysql_version() >= 50503)
|
||||
$post['body_nomarkup'] = $post['body']; // Assume we're using the utf8mb4 charset
|
||||
else
|
||||
$post['body_nomarkup'] = preg_replace('/[\x{010000}-\x{ffffff}]/u', '', $post['body']); // MySQL's `utf8` charset only supports up to 3-byte symbols
|
||||
|
||||
if (!($mod && isset($post['raw']) && $post['raw']))
|
||||
$post['tracked_cites'] = markup($post['body'], true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue