forked from GithubBackups/vichan
Merge pull request #411 from bui/images-disabled
actually check if images are disabled
This commit is contained in:
commit
26ca2f11e8
@ -561,6 +561,9 @@
|
|||||||
// When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
|
// When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
|
||||||
$config['field_email_selectbox'] = &$config['field_disable_name'];
|
$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
|
// When true, the sage won't be displayed
|
||||||
$config['hide_sage'] = false;
|
$config['hide_sage'] = false;
|
||||||
|
|
||||||
@ -1117,7 +1120,7 @@
|
|||||||
$config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
|
$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']['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']['captcha'] = _('You seem to have mistyped the verification.');
|
||||||
|
$config['error']['images_disabled'] = _('Uploading files is disabled on this board.');
|
||||||
|
|
||||||
// mod.php errors
|
// mod.php errors
|
||||||
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
|
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
|
||||||
|
@ -57,7 +57,6 @@
|
|||||||
$config['show_ratio'] = true;
|
$config['show_ratio'] = true;
|
||||||
//$config['allow_upload_by_url'] = true;
|
//$config['allow_upload_by_url'] = true;
|
||||||
$config['max_filesize'] = 1024 * 1024 * 8; // 8MB
|
$config['max_filesize'] = 1024 * 1024 * 8; // 8MB
|
||||||
$config['disable_images'] = false;
|
|
||||||
$config['spoiler_images'] = true;
|
$config['spoiler_images'] = true;
|
||||||
$config['image_reject_repost'] = true;
|
$config['image_reject_repost'] = true;
|
||||||
$config['allowed_ext_files'][] = 'webm';
|
$config['allowed_ext_files'][] = 'webm';
|
||||||
|
4
post.php
4
post.php
@ -407,6 +407,10 @@ elseif (isset($_POST['post'])) {
|
|||||||
if ($tor && !$config['tor_posting'])
|
if ($tor && !$config['tor_posting'])
|
||||||
error('Sorry. The owner of this board has decided not to allow Tor posters for some reason...');
|
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']))) {
|
if (!($post['has_file'] || isset($post['embed'])) || (($post['op'] && $config['force_body_op']) || (!$post['op'] && $config['force_body']))) {
|
||||||
// http://stackoverflow.com/a/4167053
|
// http://stackoverflow.com/a/4167053
|
||||||
$stripped_whitespace = preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $post['body']);
|
$stripped_whitespace = preg_replace('/^[\pZ\pC]+|[\pZ\pC]+$/u', '', $post['body']);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user