1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-28 09:20:58 +01:00

Merge pull request #411 from bui/images-disabled

actually check if images are disabled
This commit is contained in:
Fredrick Brennan 2015-03-06 18:03:44 +08:00
commit 26ca2f11e8
3 changed files with 8 additions and 2 deletions

View File

@ -561,6 +561,9 @@
// When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
$config['field_email_selectbox'] = &$config['field_disable_name'];
// Prevent users from uploading files.
$config['disable_images'] = false;
// When true, the sage won't be displayed
$config['hide_sage'] = false;
@ -1117,7 +1120,7 @@
$config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
$config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
$config['error']['captcha'] = _('You seem to have mistyped the verification.');
$config['error']['images_disabled'] = _('Uploading files is disabled on this board.');
// mod.php errors
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');

View File

@ -57,7 +57,6 @@
$config['show_ratio'] = true;
//$config['allow_upload_by_url'] = true;
$config['max_filesize'] = 1024 * 1024 * 8; // 8MB
$config['disable_images'] = false;
$config['spoiler_images'] = true;
$config['image_reject_repost'] = true;
$config['allowed_ext_files'][] = 'webm';

View File

@ -406,6 +406,10 @@ elseif (isset($_POST['post'])) {
error('Sorry. Tor users can\'t upload files.');
if ($tor && !$config['tor_posting'])
error('Sorry. The owner of this board has decided not to allow Tor posters for some reason...');
if ($post['has_file'] && $config['disable_images']) {
error($config['error']['images_disabled']);
}
if (!($post['has_file'] || isset($post['embed'])) || (($post['op'] && $config['force_body_op']) || (!$post['op'] && $config['force_body']))) {
// http://stackoverflow.com/a/4167053