1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-29 01:34:31 +01:00
This commit is contained in:
8chan 2014-11-13 05:08:40 +00:00
commit a68d8628a5
3 changed files with 24 additions and 4 deletions

View File

@ -603,6 +603,17 @@
// How many ban appeals can be made for a single ban? // How many ban appeals can be made for a single ban?
$config['ban_appeals_max'] = 1; $config['ban_appeals_max'] = 1;
// Blacklisted board names. Default values to protect existing folders in the core codebase.
$config['banned_boards'] = array(
'.git',
'inc',
'js',
'static',
'stylesheets',
'templates',
'tools'
);
// Show moderator name on ban page. // Show moderator name on ban page.
$config['show_modname'] = false; $config['show_modname'] = false;
@ -1410,7 +1421,7 @@
$config['mod']['view_banlist'] = MOD; $config['mod']['view_banlist'] = MOD;
// View the username of the mod who made a ban // View the username of the mod who made a ban
$config['mod']['view_banstaff'] = MOD; $config['mod']['view_banstaff'] = MOD;
// If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission, show him just // If the moderator doesn't fit the $config['mod']['view_banstaff'] (previous) permission, show him just
// a "?" instead. Otherwise, it will be "Mod" or "Admin". // a "?" instead. Otherwise, it will be "Mod" or "Admin".
$config['mod']['view_banquestionmark'] = false; $config['mod']['view_banquestionmark'] = false;
// Show expired bans in the ban list (they are kept in cache until the culprit returns) // Show expired bans in the ban list (they are kept in cache until the culprit returns)

View File

@ -495,7 +495,15 @@ function mod_new_board() {
if (openBoard($_POST['uri'])) { if (openBoard($_POST['uri'])) {
error(sprintf($config['error']['boardexists'], $board['url'])); error(sprintf($config['error']['boardexists'], $board['url']));
} }
foreach ($config['banned_boards'] as $i => $w) {
if ($w[0] !== '/') {
if (strpos($_POST['uri'],$w) !== false)
error(_("Cannot create board with banned word $w"));
} else {
if (preg_match($w,$_POST['uri']))
error(_("Cannot create board matching banned pattern $w"));
}
}
$query = prepare('INSERT INTO ``boards`` (``uri``, ``title``, ``subtitle``) VALUES (:uri, :title, :subtitle)'); $query = prepare('INSERT INTO ``boards`` (``uri``, ``title``, ``subtitle``) VALUES (:uri, :title, :subtitle)');
$query->bindValue(':uri', $_POST['uri']); $query->bindValue(':uri', $_POST['uri']);
$query->bindValue(':title', $_POST['title']); $query->bindValue(':title', $_POST['title']);

View File

@ -227,6 +227,7 @@ CREATE TABLE IF NOT EXISTS `reports` (
`board` varchar(58) CHARACTER SET utf8 DEFAULT NULL, `board` varchar(58) CHARACTER SET utf8 DEFAULT NULL,
`post` int(11) NOT NULL, `post` int(11) NOT NULL,
`reason` text NOT NULL, `reason` text NOT NULL,
`local` tinyint(1) NOT NULL DEFAULT '0',
`global` tinyint(1) NOT NULL DEFAULT '0', `global` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ; ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;