diff --git a/inc/8chan-mod-pages.php b/inc/8chan-mod-pages.php index 7569b986..17e1306d 100644 --- a/inc/8chan-mod-pages.php +++ b/inc/8chan-mod-pages.php @@ -528,8 +528,14 @@ FLAGS; $force_subject_op = isset($_POST['force_subject_op']) ? 'true' : 'false'; $force_flag = isset($_POST['force_flag']) ? 'true' : 'false'; $tor_posting = isset($_POST['tor_posting']) ? 'true' : 'false'; + $tor_image_posting = isset($_POST['tor_image_posting']) ? 'true' : 'false'; $new_thread_capt = isset($_POST['new_thread_capt']) ? 'true' : 'false'; $oekaki = ($imgboard || $fileboard) && isset($_POST['oekaki']) ? 'true' : 'false'; + $view_bumplock = isset($_POST['view_bumplock']) ? '-1' : 'MOD'; + + if (($tor_image_posting === 'true') && isset($_POST['meta_noindex'])) { + error('Please index your board to enable this.'); + } if ($_POST['locale'] !== 'en' && in_array($_POST['locale'], $possible_languages)) { $locale = "\$config['locale'] = '{$_POST['locale']}.UTF-8';"; @@ -706,12 +712,14 @@ FLAGS; \$config['force_subject_op'] = $force_subject_op; \$config['force_flag'] = $force_flag; \$config['tor_posting'] = $tor_posting; +\$config['tor_image_posting'] = $tor_image_posting; \$config['new_thread_capt'] = $new_thread_capt; \$config['hour_max_threads'] = $hour_max_threads; \$config['reply_limit'] = $reply_limit; \$config['max_pages'] = $max_pages; \$config['max_newlines'] = $max_newlines; \$config['oekaki'] = $oekaki; +\$config['mod']['view_bumplock'] = $view_bumplock; $code_tags $katex $replace $multiimage $allow_flash $allow_pdf $user_flags $assets $locale @@ -735,7 +743,7 @@ EOT; foreach ($matched[0] as $match) { $match_okay = false; foreach ($config['allowed_offsite_urls'] as $allowed_url) { - if (strpos($match, $allowed_url) !== false && strpos($match, '#') === false) { + if (strpos($match, $allowed_url) !== false && strpos($match, '#') === false && strpos($match, '?') === false && strpos($match, ';') === false) { $match_okay = true; } } diff --git a/post.php b/post.php index 576a17bd..3bee1913 100644 --- a/post.php +++ b/post.php @@ -449,8 +449,8 @@ elseif (isset($_POST['post'])) { $tor = checkDNSBL(); if ($tor && !(isset($_SERVER['HTTP_X_TOR'], $_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] == '127.0.0.2' && $_SERVER['HTTP_X_TOR'] = 'true')) error('To post on 8chan over Tor, you must use the hidden service for security reasons. You can find it at http://fullchan4jtta4sx.onion.'); - if ($tor && $post['has_file']) - error('Sorry. Tor users can\'t upload files.'); + if ($tor && $post['has_file'] && !$config['tor_image_posting']) + error('Sorry. Tor users can\'t upload files on this board.'); if ($tor && !$config['tor_posting']) error('Sorry. The owner of this board has decided not to allow Tor posters for some reason...'); @@ -946,7 +946,7 @@ elseif (isset($_POST['post'])) { // Commit the post to the database. $post['id'] = $id = post($post); - insertFloodPost($post); + if (!$tor) insertFloodPost($post); // Update statistics for this board. updateStatisticsForPost( $post ); diff --git a/templates/mod/settings.html b/templates/mod/settings.html index 2bfc680a..becac62e 100644 --- a/templates/mod/settings.html +++ b/templates/mod/settings.html @@ -42,7 +42,7 @@