diff --git a/banners.php b/banners.php
index 2707ca5c..fd345cc9 100644
--- a/banners.php
+++ b/banners.php
@@ -8,7 +8,7 @@ header("Expires: 0");
function get_custom_banner(&$b) {
# Validate the board name
- if (!(isset($b) && preg_match('/^[a-z0-9]{1,30}$/', $b)))
+ if (!(isset($b) && preg_match('/^[a-z0-9+]{1,30}$/', $b)))
return null;
# Check if directory exists
diff --git a/inc/config.php b/inc/config.php
index b54d0e0f..1769ed6a 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -1083,6 +1083,7 @@
$config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');
$config['error']['dnsbl'] = _('Your IP address is listed in %s.');
$config['error']['toomanylinks'] = _('Too many links; flood detected.');
+ $config['error']['notenoughlinks'] = _('OPs are required to have at least %d links on this board.');
$config['error']['toomanycites'] = _('Too many cites; post discarded.');
$config['error']['toomanycross'] = _('Too many cross-board links; post discarded.');
$config['error']['nodelete'] = _('You didn\'t select anything to delete.');
@@ -1680,7 +1681,7 @@
// Regex for board URIs. Don't add "`" character or any Unicode that MySQL can't handle. 58 characters
// is the absolute maximum, because MySQL cannot handle table names greater than 64 characters.
- $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}';
+ $config['board_regex'] = '[0-9a-zA-Z\+$_\x{0080}-\x{FFFF}]{1,58}';
// Youtube.js embed HTML code
$config['youtube_js_html'] = '
'.
diff --git a/inc/functions.php b/inc/functions.php
index 2d505173..93206d5f 100755
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1703,7 +1703,7 @@ function extract_modifiers($body) {
return $modifiers;
}
-function markup(&$body, $track_cites = false) {
+function markup(&$body, $track_cites = false, $op = false) {
global $board, $config, $markup_urls;
$modifiers = extract_modifiers($body);
@@ -1741,6 +1741,9 @@ function markup(&$body, $track_cites = false) {
if ($num_links > $config['max_links'])
error($config['error']['toomanylinks']);
+
+ if ($num_links < $config['min_links'] && $op)
+ error(sprintf($config['error']['notenoughlinks'], $config['min_links']));
}
if ($config['markup_repair_tidy'])
diff --git a/inc/instance-config.php b/inc/instance-config.php
index 2c183707..896eb3a1 100644
--- a/inc/instance-config.php
+++ b/inc/instance-config.php
@@ -74,7 +74,7 @@
$config['mod']['capcode'][MOD] = array('Board Owner');
$config['mod']['capcode'][GLOBALVOLUNTEER] = array('Global Volunteer');
$config['custom_capcode']['Admin'] = array(
- '
%s',
+ '
8chan.co Administrator',
);
//$config['mod']['view_banlist'] = GLOBALVOLUNTEER;
$config['mod']['recent_reports'] = 65535;
@@ -91,6 +91,7 @@
//$config['default_stylesheet'] = array('Notsuba', 'notsuba.css');
$config['additional_javascript'][] = 'js/jquery.min.js';
$config['additional_javascript'][] = 'js/jquery.mixitup.min.js';
+ $config['additional_javascript'][] = 'js/jquery-ui.custom.min.js';
$config['additional_javascript'][] = 'js/catalog.js';
$config['additional_javascript'][] = 'js/captcha.js';
$config['additional_javascript'][] = 'js/jquery.tablesorter.min.js';
@@ -150,8 +151,9 @@
$config['markup'][] = array("/\[spoiler\](.+?)\[\/spoiler\]/", "
\$1");
$config['markup'][] = array("/~~(.+?)~~/", "
\$1");
$config['markup'][] = array("/__(.+?)__/", "
\$1");
+ $config['markup'][] = array("/###([^\s']+)###/", "
###\$1###");
- $config['boards'] = array(array('
' => '/', '
' => '/boards.html', '
' => '/faq.html', '
' => '/random.php', '
' => '/create.php', '
' => '/bans.html', '
' => '/search.php', '
' => '/mod.php', '
' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta'), array(''=>'https://twitter.com/infinitechan'));
+ $config['boards'] = array(array('
' => '/', '
' => '/boards.html', '
' => '/faq.html', '
' => '/random.php', '
' => '/create.php', '
' => '/bans.html', '
' => '/search.php', '
' => '/mod.php', '
' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'news+'), array(''=>'https://twitter.com/infinitechan'));
//$config['boards'] = array(array('
' => '/', '
' => '/boards.html', '
' => '/faq.html', '
' => '/random.php', '
' => '/create.php', '
' => '/search.php', '
' => '/mod.php', '
' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array(''=>'https://twitter.com/infinitechan'));
$config['footer'][] = 'All posts on 8chan.co are the responsibility of the individual poster and not the administration of 8chan.co, pursuant to 47 U.S.C. § 230.';
@@ -195,6 +197,9 @@
$config['gzip_static'] = false;
$config['hash_masked_ip'] = true;
+$config['force_subject_op'] = false;
+$config['min_links'] = 0;
+$config['min_body'] = 0;
// 8chan specific mod pages
require '8chan-mod-pages.php';
diff --git a/post.php b/post.php
index 1a7c5da2..37092bba 100644
--- a/post.php
+++ b/post.php
@@ -399,6 +399,13 @@ elseif (isset($_POST['post'])) {
error($config['error']['tooshort_body']);
}
}
+
+ if ($config['force_subject_op'] && $post['op']) {
+ $stripped_whitespace = preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $post['subject']);
+ if ($stripped_whitespace == '') {
+ error(_('It is required to enter a subject when starting a new thread on this board.'));
+ }
+ }
if (!$post['op']) {
// Check if thread is locked
@@ -523,6 +530,8 @@ elseif (isset($_POST['post'])) {
error(sprintf($config['error']['toolong'], 'subject'));
if (!$mod && mb_strlen($post['body']) > $config['max_body'])
error($config['error']['toolong_body']);
+ if (mb_strlen($post['body']) < $config['min_body'] && $post['op'])
+ error(_(sprintf('OP must be at least %d chars on this board.', $config['min_body'])));
if (mb_strlen($post['password']) > 20)
error(sprintf($config['error']['toolong'], 'password'));
@@ -588,7 +597,7 @@ elseif (isset($_POST['post'])) {
}
}
- $post['tracked_cites'] = markup($post['body'], true);
+ $post['tracked_cites'] = markup($post['body'], true, $post['op']);
diff --git a/templates/index.html b/templates/index.html
index 5638fd65..e422b8bc 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -18,7 +18,7 @@
{{ boardlist.top }}
{% if pm %}
You have
an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.
{% endif %}
- {% if config.url_banner %}

{% endif %}
+ {% if config.url_banner %}

{% endif %}
{{ board.url }} - {{ board.title|e }}
diff --git a/templates/main.js b/templates/main.js
index 0156e23b..44b3dd96 100644
--- a/templates/main.js
+++ b/templates/main.js
@@ -188,7 +188,7 @@ function changeStyle(styleName, link) {
{% endraw %}
function init_stylechooser() {
- var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page50|replace({'+': '\\+', '%d': '\\d+', '.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.catalog_link|replace({'.': '\\.'}) }})/);
+ var matches = document.URL.match(/\/([0-9a-zA-Z\+$_\u0080-\uFFFF]{1,58})\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page50|replace({'+': '\\+', '%d': '\\d+', '.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.catalog_link|replace({'.': '\\.'}) }})/);
var newElement = document.createElement('div');
newElement.className = 'styles';