[a-f0-9]{8}))?';
- $new_pages[@$key[0] == '!' ? $key : '!^' . $key . '(?:&[^&=]+=[^&]*)*$!'] = $callback;
+ $key = str_replace('\%b', $config['board_regex'], $key);
+ $new_pages[@$key[0] == '!' ? $key : '!^' . $key . '(?:&[^&=]+=[^&]*)*$!u'] = $callback;
}
$pages = $new_pages;
diff --git a/post.php b/post.php
index 062acc5f..d2e92be5 100644
--- a/post.php
+++ b/post.php
@@ -172,7 +172,7 @@ if (isset($_POST['delete'])) {
error($config['error']['bot']);
// Check the referrer
- if (!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], $_SERVER['HTTP_REFERER']))
+ if (!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], urldecode($_SERVER['HTTP_REFERER'])))
error($config['error']['referer']);
checkDNSBL();
@@ -380,7 +380,10 @@ if (isset($_POST['delete'])) {
wordfilters($post['body']);
- $post['body_nomarkup'] = $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);
@@ -546,9 +549,9 @@ if (isset($_POST['delete'])) {
// Remove board directories before inserting them into the database.
if ($post['has_file']) {
$post['file_path'] = $post['file'];
- $post['file'] = substr_replace($post['file'], '', 0, mb_strlen($board['dir'] . $config['dir']['img']));
+ $post['file'] = mb_substr($post['file'], mb_strlen($board['dir'] . $config['dir']['img']));
if ($is_an_image && $post['thumb'] != 'spoiler')
- $post['thumb'] = substr_replace($post['thumb'], '', 0, mb_strlen($board['dir'] . $config['dir']['thumb']));
+ $post['thumb'] = mb_substr($post['thumb'], mb_strlen($board['dir'] . $config['dir']['thumb']));
}
$post = (object)$post;
diff --git a/templates/mod/log.html b/templates/mod/log.html
index e75330b5..0aa3f110 100644
--- a/templates/mod/log.html
+++ b/templates/mod/log.html
@@ -18,7 +18,11 @@
{% endif %}
- {{ log.ip }}
+ {% if mod|hasPermission(config.mod.show_ip_modlog) %}
+ {{ log.ip }}
+ {% else %}
+ hidden
+ {% endif %}
|
{{ log.time|ago }}
diff --git a/templates/post_form.html b/templates/post_form.html
index 0ea2b999..391f0657 100644
--- a/templates/post_form.html
+++ b/templates/post_form.html
@@ -88,7 +88,7 @@
|
{% endif %}
- {% if mod %}
+ {% if mod and ((not id and post.mod|hasPermission(config.mod.sticky, board.uri)) or (not id and post.mod|hasPermission(config.mod.lock, board.uri)) or post.mod|hasPermission(config.mod.rawhtml, board.uri)) %}
{% trans %}Flags{% endtrans %}
diff --git a/templates/posts.sql b/templates/posts.sql
index c766d38e..0a1dc92a 100644
--- a/templates/posts.sql
+++ b/templates/posts.sql
@@ -1,32 +1,33 @@
CREATE TABLE IF NOT EXISTS `posts_{{ board }}` (
- `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `thread` int(11) DEFAULT NULL,
- `subject` varchar(100) DEFAULT NULL,
- `email` varchar(30) DEFAULT NULL,
- `name` varchar(35) DEFAULT NULL,
- `trip` varchar(15) DEFAULT NULL,
- `capcode` varchar(50) DEFAULT NULL,
- `body` text NOT NULL,
- `body_nomarkup` text DEFAULT NULL,
- `time` int(11) NOT NULL,
- `bump` int(11) DEFAULT NULL,
- `thumb` varchar(50) DEFAULT NULL,
- `thumbwidth` int(11) DEFAULT NULL,
- `thumbheight` int(11) DEFAULT NULL,
- `file` varchar(50) DEFAULT NULL,
- `filewidth` int(11) DEFAULT NULL,
- `fileheight` int(11) DEFAULT NULL,
- `filesize` int(11) DEFAULT NULL,
- `filename` text DEFAULT NULL,
- `filehash` text DEFAULT NULL,
- `password` varchar(20) DEFAULT NULL,
- `ip` varchar(45) NOT NULL,
- `sticky` int(1) NOT NULL,
- `locked` int(1) NOT NULL,
- `sage` int(1) NOT NULL,
- `embed` text,
- UNIQUE KEY `id` (`id`),
- KEY `thread_id` (`thread`, `id`),
- KEY `time` (`time`),
- FULLTEXT KEY `body` (`body`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
+ `thread` int(11) DEFAULT NULL,
+ `subject` varchar(100) DEFAULT NULL,
+ `email` varchar(30) DEFAULT NULL,
+ `name` varchar(35) DEFAULT NULL,
+ `trip` varchar(15) DEFAULT NULL,
+ `capcode` varchar(50) DEFAULT NULL,
+ `body` text NOT NULL,
+ `body_nomarkup` text,
+ `time` int(11) NOT NULL,
+ `bump` int(11) DEFAULT NULL,
+ `thumb` varchar(50) DEFAULT NULL,
+ `thumbwidth` int(11) DEFAULT NULL,
+ `thumbheight` int(11) DEFAULT NULL,
+ `file` varchar(50) DEFAULT NULL,
+ `filewidth` int(11) DEFAULT NULL,
+ `fileheight` int(11) DEFAULT NULL,
+ `filesize` int(11) DEFAULT NULL,
+ `filename` text,
+ `filehash` text CHARACTER SET ascii,
+ `password` varchar(20) DEFAULT NULL,
+ `ip` varchar(39) CHARACTER SET ascii NOT NULL,
+ `sticky` int(1) NOT NULL,
+ `locked` int(1) NOT NULL,
+ `sage` int(1) NOT NULL,
+ `embed` text,
+ UNIQUE KEY `id` (`id`),
+ KEY `thread_id` (`thread`,`id`),
+ KEY `time` (`time`),
+ FULLTEXT KEY `body` (`body`)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
+
\ No newline at end of file
|