This commit is contained in:
8chan 2015-02-26 09:11:48 +00:00
commit 3e68a3e8b8
8 changed files with 17 additions and 6 deletions

View File

@ -448,6 +448,7 @@ FLAGS;
$poster_ids = isset($_POST['poster_ids']) ? 'true' : 'false'; $poster_ids = isset($_POST['poster_ids']) ? 'true' : 'false';
$show_sages = isset($_POST['show_sages']) ? 'true' : 'false'; $show_sages = isset($_POST['show_sages']) ? 'true' : 'false';
$auto_unicode = isset($_POST['auto_unicode']) ? 'true' : 'false'; $auto_unicode = isset($_POST['auto_unicode']) ? 'true' : 'false';
$strip_combining_chars = isset($_POST['strip_combining_chars']) ? 'true' : 'false';
$allow_roll = isset($_POST['allow_roll']) ? 'true' : 'false'; $allow_roll = isset($_POST['allow_roll']) ? 'true' : 'false';
$image_reject_repost = isset($_POST['image_reject_repost']) ? 'true' : 'false'; $image_reject_repost = isset($_POST['image_reject_repost']) ? 'true' : 'false';
$early_404 = isset($_POST['early_404']) ? 'true' : 'false'; $early_404 = isset($_POST['early_404']) ? 'true' : 'false';
@ -549,6 +550,7 @@ OEKAKI;
\$config['poster_ids'] = $poster_ids; \$config['poster_ids'] = $poster_ids;
\$config['show_sages'] = $show_sages; \$config['show_sages'] = $show_sages;
\$config['auto_unicode'] = $auto_unicode; \$config['auto_unicode'] = $auto_unicode;
\$config['strip_combining_chars'] = $strip_combining_chars;
\$config['allow_roll'] = $allow_roll; \$config['allow_roll'] = $allow_roll;
\$config['image_reject_repost'] = $image_reject_repost; \$config['image_reject_repost'] = $image_reject_repost;
\$config['early_404'] = $early_404; \$config['early_404'] = $early_404;

View File

@ -197,7 +197,7 @@ function _create_antibot($board, $thread) {
if (!isset($purged_old_antispam)) { if (!isset($purged_old_antispam)) {
$purged_old_antispam = true; $purged_old_antispam = true;
query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error()); //query('DELETE FROM ``antispam`` WHERE `expires` < UNIX_TIMESTAMP()') or error(db_error());
} }
if ($thread) if ($thread)
@ -276,6 +276,8 @@ function checkSpam(array $extra_salt = array()) {
} }
function incrementSpamHash($hash) { function incrementSpamHash($hash) {
if ($hash === true) return;
$query = prepare('UPDATE ``antispam`` SET `passed` = `passed` + 1 WHERE `hash` = :hash'); $query = prepare('UPDATE ``antispam`` SET `passed` = `passed` + 1 WHERE `hash` = :hash');
$query->bindValue(':hash', $hash); $query->bindValue(':hash', $hash);
$query->execute() or error(db_error($query)); $query->execute() or error(db_error($query));

View File

@ -1089,7 +1089,7 @@
$config['error']['image_hard_limit'] = _('Thread has reached its maximum image limit.'); $config['error']['image_hard_limit'] = _('Thread has reached its maximum image limit.');
$config['error']['nopost'] = _('You didn\'t make a post.'); $config['error']['nopost'] = _('You didn\'t make a post.');
$config['error']['flood'] = _('Flood detected; Post discarded.'); $config['error']['flood'] = _('Flood detected; Post discarded.');
$config['error']['spam'] = _('Your request looks automated; Post discarded.'); $config['error']['spam'] = _('Your request looks automated; Post discarded. Try refreshing the page.');
$config['error']['unoriginal'] = _('Unoriginal content!'); $config['error']['unoriginal'] = _('Unoriginal content!');
$config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.'); $config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
$config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.'); $config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');

View File

@ -1911,8 +1911,11 @@ function markup(&$body, $track_cites = false, $op = false) {
} }
// Restore old board // Restore old board
if ($board['uri'] != $tmp_board) if (!$tmp_board) {
unset($GLOBALS['board']);
} elseif ($board['uri'] != $tmp_board) {
openBoard($tmp_board); openBoard($tmp_board);
}
foreach ($cites as $matches) { foreach ($cites as $matches) {
$_board = $matches[2][0]; $_board = $matches[2][0];

View File

@ -204,6 +204,8 @@ $config['mask_db_error'] = true;
$config['ban_appeals'] = true; $config['ban_appeals'] = true;
$config['show_sages'] = false; $config['show_sages'] = false;
$config['katex'] = false; $config['katex'] = false;
$config['enable_antibot'] = true;
$config['spam']['unicode'] = false;
// 8chan specific mod pages // 8chan specific mod pages
require '8chan-mod-pages.php'; require '8chan-mod-pages.php';

View File

@ -283,11 +283,11 @@ elseif (isset($_POST['post'])) {
error($config['error']['noaccess']); error($config['error']['noaccess']);
} }
/*if (!$post['mod']) { if (!$post['mod']) {
$post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null)));
if ($post['antispam_hash'] === true) if ($post['antispam_hash'] === true && $config['enable_antibot'])
error($config['error']['spam']); error($config['error']['spam']);
}*/ }
if ($config['robot_enable'] && $config['robot_mute']) { if ($config['robot_enable'] && $config['robot_mute']) {
checkMute(); checkMute();

View File

@ -19,6 +19,7 @@ $safe_config['disable_images'] = $config['disable_images'];
$safe_config['poster_ids'] = $config['poster_ids']; $safe_config['poster_ids'] = $config['poster_ids'];
$safe_config['show_sages'] = $config['show_sages']; $safe_config['show_sages'] = $config['show_sages'];
$safe_config['auto_unicode'] = $config['auto_unicode']; $safe_config['auto_unicode'] = $config['auto_unicode'];
$safe_config['strip_combining_chars'] = $config['strip_combining_chars'];
$safe_config['allow_roll'] = $config['allow_roll']; $safe_config['allow_roll'] = $config['allow_roll'];
$safe_config['image_reject_repost'] = $config['image_reject_repost']; $safe_config['image_reject_repost'] = $config['image_reject_repost'];
$safe_config['early_404'] = $config['early_404']; $safe_config['early_404'] = $config['early_404'];

View File

@ -34,6 +34,7 @@
<tr><th>{% trans %}Poster ID's{% endtrans %}</th><td><input type="checkbox" name="poster_ids" {% if config.poster_ids %}checked{% endif %}></td></tr> <tr><th>{% trans %}Poster ID's{% endtrans %}</th><td><input type="checkbox" name="poster_ids" {% if config.poster_ids %}checked{% endif %}></td></tr>
<tr><th>{% trans %}Display SAGE! after saged posts{% endtrans %}</th><td><input type="checkbox" name="show_sages" {% if config.show_sages %}checked{% endif %}></td></tr> <tr><th>{% trans %}Display SAGE! after saged posts{% endtrans %}</th><td><input type="checkbox" name="show_sages" {% if config.show_sages %}checked{% endif %}></td></tr>
<tr><th>{% trans %}Automatically convert ... to …{% endtrans %}</th><td><input type="checkbox" name="auto_unicode" {% if config.auto_unicode %}checked{% endif %}></td></tr> <tr><th>{% trans %}Automatically convert ... to …{% endtrans %}</th><td><input type="checkbox" name="auto_unicode" {% if config.auto_unicode %}checked{% endif %}></td></tr>
<tr><th>{% trans %}Disallow combining characters ("Zalgo", Vietnamese text){% endtrans %}</th><td><input type="checkbox" name="strip_combining_chars" {% if config.strip_combining_chars %}checked{% endif %}></td></tr>
<tr><th>{% trans %}No index{% endtrans %}<br><span class="unimportant">{% trans %}Hide from boards index<br/>and do not index in search engines{% endtrans %}</span></th><td><input type="checkbox" name="meta_noindex" {% if not board.indexed %}checked{% endif %}></td></tr> <tr><th>{% trans %}No index{% endtrans %}<br><span class="unimportant">{% trans %}Hide from boards index<br/>and do not index in search engines{% endtrans %}</span></th><td><input type="checkbox" name="meta_noindex" {% if not board.indexed %}checked{% endif %}></td></tr>
<tr><th>{% trans %}Archive my board on 8archive.moe{% endtrans %}<br><span class="unimportant">{% trans %}This archives your board on 8archive.moe if you opt in{% endtrans %}</span></th><td><input type="checkbox" name="8archive" {% if board['8archive'] %}checked{% endif %}></td></tr> <tr><th>{% trans %}Archive my board on 8archive.moe{% endtrans %}<br><span class="unimportant">{% trans %}This archives your board on 8archive.moe if you opt in{% endtrans %}</span></th><td><input type="checkbox" name="8archive" {% if board['8archive'] %}checked{% endif %}></td></tr>
<tr><th>{% trans %}[code] tags{% endtrans %}</th><td><input type="checkbox" name="code_tags" {% if 'js/code_tags/run_prettify.js' in config.additional_javascript %}checked{% endif %}></td></tr> <tr><th>{% trans %}[code] tags{% endtrans %}</th><td><input type="checkbox" name="code_tags" {% if 'js/code_tags/run_prettify.js' in config.additional_javascript %}checked{% endif %}></td></tr>