summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-30 22:08:56 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-30 22:08:56 -0400
commit8efab06616bfcdab49fb9e996cdc7ddfe79426bb (patch)
tree46f03f9ee1623c87fb8e3fe4a1f92cc1e7532b0f /post.php
parent91bb3182da63e64d45ab8ac26735e090db928f15 (diff)
Upgrade to utf8mb4 charset for MySQL server versions above 5.5.3. Keep support for older versions. Fix charsets for multiple columns and tables.
Diffstat (limited to 'post.php')
-rw-r--r--post.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/post.php b/post.php
index e9041ce8..d1749fd1 100644
--- a/post.php
+++ b/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);