Compare commits
27 Commits
8613768192
...
9e944dc189
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 41 KiB |
After Width: | Height: | Size: 8.6 KiB |
After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 64 KiB |
After Width: | Height: | Size: 51 KiB |
|
@ -295,13 +295,19 @@ function checkSpam(array $extra_salt = array()) {
|
|||
#print_err("checkSpam start");
|
||||
$extra_salt_orig = $extra_salt;
|
||||
|
||||
/*
|
||||
if (!isset($_POST['hash'])) {
|
||||
print_err("checkSpam: _POST array doesn't have key 'hash', check failed.");
|
||||
dumpVars($extra_salt_orig);
|
||||
return true;
|
||||
}
|
||||
*/
|
||||
|
||||
$hash = $_POST['hash'];
|
||||
if (isset($_POST['hash'])) {
|
||||
$hash = $_POST['hash'];
|
||||
} else {
|
||||
$hash = "";
|
||||
}
|
||||
|
||||
if (!empty($extra_salt)) {
|
||||
// create a salted hash of the "extra salt"
|
||||
|
@ -336,7 +342,12 @@ function checkSpam(array $extra_salt = array()) {
|
|||
// Use SHA1 for the hash
|
||||
$_hash = sha1($_hash . $extra_salt);
|
||||
|
||||
if ($hash != $_hash) {
|
||||
if (empty($hash)) {
|
||||
print_err("checkSpam: hash is either empty or was never present, check failed. Not flagging as spam however.");
|
||||
dumpVars($extra_salt_orig);
|
||||
// Ignore missing hash, because it was missing for some legitimate posters and bots tend to fill in any field.
|
||||
return false;
|
||||
} else if ($hash != $_hash) {
|
||||
print_err("checkSpam: Hash values do not match! submitted hash value from POST data: $hash ; Computed hash value: $_hash");
|
||||
dumpVars($extra_salt_orig);
|
||||
return true;
|
||||
|
|
|
@ -24,6 +24,42 @@ register_shutdown_function('fatal_error_handler');
|
|||
|
||||
$error_recursion=false;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Global anything is always a bad idea, but since all of this website's error handling comes
|
||||
* down to calling this error function and quitting, we have no way of catching exceptions, for example
|
||||
* during thumbnail creation.
|
||||
*
|
||||
* So push things to run in case of a crash into a list, and then run all of them in error.
|
||||
*
|
||||
* This will be exclusive to callbacks for posting a post callflow, not mod actions or anything else.
|
||||
*/
|
||||
function global_post_cleanup() {
|
||||
global $post_cleanup_list;
|
||||
|
||||
foreach ($post_cleanup_list as $f) {
|
||||
$f();
|
||||
}
|
||||
|
||||
unset($post_cleanup_list);
|
||||
}
|
||||
|
||||
function push_global_post_cleanup($f) {
|
||||
global $post_cleanup_list;
|
||||
|
||||
if (!isset($post_cleanup_list)) {
|
||||
$post_cleanup_list = array($f);
|
||||
} else {
|
||||
array_push($post_cleanup_list, $f);
|
||||
}
|
||||
}
|
||||
|
||||
function init_global_post_cleanup() {
|
||||
global $post_cleanup_list;
|
||||
$post_cleanup_list = array();
|
||||
}
|
||||
|
||||
function error($message, $priority = true, $debug_stuff = false) {
|
||||
global $board, $mod, $config, $db_error, $error_recursion;
|
||||
|
||||
|
@ -75,11 +111,14 @@ function error($message, $priority = true, $debug_stuff = false) {
|
|||
$data['debug']=$debug_stuff;
|
||||
}
|
||||
print json_encode($data);
|
||||
global_post_cleanup();
|
||||
exit();
|
||||
}
|
||||
|
||||
header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
|
||||
|
||||
global_post_cleanup();
|
||||
|
||||
die(Element('page.html', array(
|
||||
'config' => $config,
|
||||
'title' => _('Error'),
|
||||
|
|
928
inc/image.php
|
@ -22,6 +22,7 @@ $config['boards'] = array(
|
|||
'edu',
|
||||
'ga',
|
||||
'ent',
|
||||
'music',
|
||||
'777',
|
||||
'posad',
|
||||
'i',
|
||||
|
@ -50,6 +51,7 @@ $config['categories'] = array(
|
|||
'edu',
|
||||
'ga',
|
||||
'ent',
|
||||
'music',
|
||||
'777',
|
||||
'posad',
|
||||
'i',
|
||||
|
@ -67,7 +69,8 @@ $config['custom_categories'] = array(
|
|||
'New Multitude' => 'https://newmultitude.org',
|
||||
'Booru image repository' => 'https://lefty.pictures',
|
||||
'Official chat room' => 'https://talk.leftychan.net/#/room/#welcome:matrix.leftychan.net',
|
||||
'Gitea instance' => 'https://git.leftychan.net',
|
||||
'Nukechan' => 'https://nukechan.net',
|
||||
#'Gitea instance' => 'https://git.leftychan.net',
|
||||
'Rules' => 'rules.html',
|
||||
'Search' => 'search.php',
|
||||
),
|
||||
|
@ -259,6 +262,7 @@ $config['user_flags'] = array (
|
|||
'egalitarianism' => 'Egalitarianism',
|
||||
'egoism' => 'Egoism',
|
||||
'eristocracy' => 'Έριστοκρατία',
|
||||
'Eurasianism' => 'Eurasianism',
|
||||
'eureka' => 'Eureka',
|
||||
'eurocommunism' => 'Eurocommunism',
|
||||
'farc' => 'Las FARC',
|
||||
|
@ -285,7 +289,7 @@ $config['user_flags'] = array (
|
|||
'marxism_blackpilism' => 'Marxism Blackpillism',
|
||||
'mutualism' => 'Mutualism',
|
||||
'naxalite' => 'Naxalite',
|
||||
'nazbol' => 'Nazbol',
|
||||
'nazbol' => 'National Bolshevik',
|
||||
'nazi' => 'Nazi',
|
||||
'ndfp' => 'NDFP',
|
||||
'palestine' => 'Palestine',
|
||||
|
@ -312,12 +316,14 @@ $config['user_flags'] = array (
|
|||
'syndicalism' => 'Syndicalism',
|
||||
'tankie' => 'Tankie',
|
||||
'technocracy' => 'Technocracy',
|
||||
'The_Other_Russia' => 'The Other Russia',
|
||||
'think' => 'Think',
|
||||
'transhumanism' => 'Transhumanism',
|
||||
'united_farm_workers' => 'United Farm Workers',
|
||||
'viet_cong' => 'Viet Cong',
|
||||
'ypg' => 'YPG',
|
||||
'yugoslavia' => 'Yugoslavia'
|
||||
'yugoslavia' => 'Yugoslavia',
|
||||
'zgang' => 'Z Gang'
|
||||
);
|
||||
|
||||
|
||||
|
|
|
@ -1501,7 +1501,7 @@ function mod_move($originBoard, $postID) {
|
|||
} else {
|
||||
deletePost($postID);
|
||||
buildIndex();
|
||||
rebuildThemes('post', $targetBoard);
|
||||
rebuildThemes('post', $originBoard);
|
||||
|
||||
openBoard($targetBoard);
|
||||
header('Location: ?/' . sprintf($config['board_path'], $newboard['uri']) . $config['dir']['res'] . link_for($op, false, $newboard), true, $config['redirect_http']);
|
||||
|
|
|
@ -32,11 +32,13 @@ $(document).ready(function(){
|
|||
thread.find('div.hidden').remove();
|
||||
var post_in_doc = thread.find('#' + $(this).attr('id'));
|
||||
if(post_in_doc.length == 0) {
|
||||
/*
|
||||
if(last_expanded) {
|
||||
$(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
|
||||
} else {
|
||||
$(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">');
|
||||
}
|
||||
*/
|
||||
last_expanded = $(this);
|
||||
$(document).trigger('new_post', this);
|
||||
} else {
|
||||
|
|
4
log.php
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
include 'inc/functions.php';
|
||||
include 'inc/mod/pages.php';
|
||||
require_once 'inc/functions.php';
|
||||
require_once 'inc/mod/pages.php';
|
||||
|
||||
if (!isset($_GET['board']) || !preg_match("/{$config['board_regex']}/u", $_GET['board'])) {
|
||||
http_response_code(400);
|
||||
|
|
13
post.php
|
@ -457,6 +457,8 @@ function validate_images(array $post_array) {
|
|||
function handle_post(){
|
||||
global $config,$dropped_post,$board, $mod,$pdo;
|
||||
|
||||
init_global_post_cleanup();
|
||||
|
||||
if (!isset($_POST['body'], $_POST['board']) && !$dropped_post) {
|
||||
error($config['error']['bot']);
|
||||
}
|
||||
|
@ -1036,6 +1038,17 @@ function handle_post(){
|
|||
|
||||
$spam_noticer_result = checkWithSpamNoticer($config, $post, $board['uri']);
|
||||
|
||||
/*
|
||||
* If we have an error with posting this later, send back the
|
||||
* delete token to spamnoticer to remove the post from the recent
|
||||
* posts table. (see error.php for the error cleanup function)
|
||||
*/
|
||||
$f_spamnoticer_cleanup_on_err = function() use ($config, $delete_token) {
|
||||
removeRecentPostFromSpamnoticer($config, array($delete_token));
|
||||
};
|
||||
|
||||
push_global_post_cleanup($f_spamnoticer_cleanup_on_err);
|
||||
|
||||
if ($spam_noticer_result->succeeded && $spam_noticer_result->noticed) {
|
||||
error($config['error']['spam_noticer'] . $spam_noticer_result->reason);
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 669 B |
After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 625 B After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 327 B |
|
@ -3,184 +3,220 @@ div.sidearrows {
|
|||
}
|
||||
|
||||
body {
|
||||
background: #1D1F21;
|
||||
color: #ACACAC;
|
||||
font-family: Courier, monospace;
|
||||
font-size: 13px;
|
||||
background: #1D1F21;
|
||||
color: #ACACAC;
|
||||
font-family: Courier, monospace;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.theme-catalog .replies {
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
div.post div.body {
|
||||
font-family: serif;
|
||||
}
|
||||
|
||||
span.heading {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.theme-catalog .replies .meta,
|
||||
.theme-catalog .replies .intro,
|
||||
div.post div.body a,
|
||||
div.post div.body .toolong {
|
||||
font-family: Courier, monospace;
|
||||
}
|
||||
|
||||
/* LINKS */
|
||||
a, a:link, a:visited, .intro a.email span.name {
|
||||
color: #FFB300;
|
||||
text-decoration: none;
|
||||
color: #FFB300;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:link:hover, a:visited:hover {
|
||||
color: #FFB300;
|
||||
text-shadow: 0px 0px 5px #117743;
|
||||
color: #FFB300;
|
||||
text-shadow: 0px 0px 5px #117743;
|
||||
}
|
||||
div.pages a.selected {
|
||||
color: #FFB300;
|
||||
color: #FFB300;
|
||||
}
|
||||
|
||||
/* INTRO */
|
||||
h1, div.title, header div.subtitle {
|
||||
color: #663E11;
|
||||
font-family: Courier, monospace;
|
||||
color: #FFB300;
|
||||
font-family: Courier, monospace;
|
||||
}
|
||||
h1 {
|
||||
font-size: 24pt;
|
||||
font-weight: normal;
|
||||
letter-spacing: 0px;
|
||||
font-size: 18pt;
|
||||
font-weight: bold;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
header div.subtitle {
|
||||
font-size: 12pt;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
/* FORMS AND BUTTONS */
|
||||
div.banner {
|
||||
background-color: inherit;
|
||||
color: #ACACAC;
|
||||
background-color: inherit;
|
||||
color: #ACACAC;
|
||||
}
|
||||
form table {
|
||||
border: 1px dashed #117743;
|
||||
padding-right: 1px;
|
||||
border: 1px dashed #117743;
|
||||
padding-right: 1px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
form table tr th {
|
||||
background: #282A2E;
|
||||
border: 1px solid #117743;
|
||||
border-radius: 5px;
|
||||
background: #282A2E;
|
||||
border: 1px solid #117743;
|
||||
border-radius: 2px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
input[type="text"], input[type="password"], textarea, select {
|
||||
border: 1px double #07371F;
|
||||
border-radius: 5px;
|
||||
background: #282A2E;
|
||||
color: #ACACAC;
|
||||
font-family: Courier, monospace;
|
||||
border: 1px double #07371F;
|
||||
border-radius: 2px;
|
||||
background: #282A2E;
|
||||
color: #ACACAC;
|
||||
font-family: Courier, monospace;
|
||||
margin: 0 1px;
|
||||
padding: 3px !important;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input[type="text"]:focus, input[type="password"]:focus, textarea:focus {
|
||||
box-shadow: 0px 0px 5px 2px #117743;
|
||||
box-shadow: 0px 0px 5px 2px #117743;
|
||||
}
|
||||
|
||||
input[type="submit"] {
|
||||
border: 3px double #07371F;
|
||||
border-radius: 5px;
|
||||
background: #16171A;
|
||||
color: #ACACAC;
|
||||
font-family: Courier, monospace;
|
||||
font-weight: bold;
|
||||
border: 3px double #07371F;
|
||||
border-radius: 2px;
|
||||
background-color: #07371F;
|
||||
color: #ACACAC;
|
||||
font-family: Courier, monospace;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
input[type="submit"]:hover {
|
||||
border-color: #117743;
|
||||
background-color: #117743;
|
||||
}
|
||||
|
||||
.dropzone {
|
||||
background: #16171A;
|
||||
border: 3px double #07371F;
|
||||
color: #ACACAC;
|
||||
background: #16171A;
|
||||
border: 1px solid #07371F;
|
||||
color: #ACACAC;
|
||||
border-radius: 2px;
|
||||
margin: 0 2px;
|
||||
}
|
||||
.dropzone .file-hint {
|
||||
color: #ACACAC;
|
||||
font-weight: bold;
|
||||
color: #ACACAC;
|
||||
font-weight: bold;
|
||||
}
|
||||
#quick-reply table {
|
||||
background: #1D1F21 !important;
|
||||
background: #1D1F21 !important;
|
||||
}
|
||||
fieldset {
|
||||
border: 1px dashed #117743;
|
||||
border: 1px dashed #117743;
|
||||
}
|
||||
|
||||
/* POST IDENTIFIERS */
|
||||
.intro span.subject {
|
||||
color: #34ED3A;
|
||||
color: #34ED3A;
|
||||
}
|
||||
.intro span.name {
|
||||
color: #117743;
|
||||
color: #117743;
|
||||
}
|
||||
.intro span.trip {
|
||||
color: #117743;
|
||||
color: #117743;
|
||||
}
|
||||
.intro a.capcode, p.intro a.nametag {
|
||||
color: #FF0000;
|
||||
font-weight: bold;
|
||||
color: #FF0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
.intro a.email, p.intro a.email span.name, p.intro a.email:hover, p.intro a.email:hover span.name {
|
||||
color: #34ED97;
|
||||
color: #34ED97;
|
||||
}
|
||||
.intro time {
|
||||
font-weight: bold;
|
||||
font-weight: bold;
|
||||
}
|
||||
.intro a.post_no {
|
||||
color: #ACACAC;
|
||||
font-weight: bold;
|
||||
color: #ACACAC;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* POST BOXES */
|
||||
div.post.reply {
|
||||
background: #282A2E;
|
||||
border: 1px solid #117743;
|
||||
border-radius: 5px;
|
||||
background: #282A2E;
|
||||
border: 1px solid #117743;
|
||||
border-radius: 2px;
|
||||
}
|
||||
div.post.reply.highlighted {
|
||||
background: rgba(59, 22, 43, 0.4);
|
||||
border: 1px solid #117743;
|
||||
border-radius: 5px;
|
||||
background: rgba(59, 22, 43, 0.4);
|
||||
border: 1px solid #117743;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
/* POST CONTENT */
|
||||
div.post.reply div.body a {
|
||||
color: #FFB300;
|
||||
color: #FFB300;
|
||||
}
|
||||
.quote {
|
||||
color: #789922;
|
||||
color: #789922;
|
||||
}
|
||||
|
||||
/* BARS */
|
||||
.bar {
|
||||
background-color: #151515;
|
||||
background-color: #151515;
|
||||
}
|
||||
.bar.top {
|
||||
border-bottom: 1px solid #B0790A;
|
||||
border-bottom: 1px solid #B0790A;
|
||||
}
|
||||
.bar.bottom {
|
||||
border-top: 1px solid #B0790A;
|
||||
border-top: 1px solid #B0790A;
|
||||
}
|
||||
div.boardlist {
|
||||
color: #ACACAC;
|
||||
color: #ACACAC;
|
||||
}
|
||||
hr {
|
||||
border: none;
|
||||
border-top: 1pt solid #117743;
|
||||
border: none;
|
||||
border-top: 1pt solid #117743;
|
||||
}
|
||||
|
||||
/* CATALOG */
|
||||
.theme-catalog h1 {
|
||||
color: #ACACAC;
|
||||
font-size: 18pt;
|
||||
font-weight: bold;
|
||||
color: #ACACAC;
|
||||
font-size: 18pt;
|
||||
font-weight: bold;
|
||||
}
|
||||
.theme-catalog h1 a {
|
||||
font-weight: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
.theme-catalog div.thread, .theme-catalog div.thread:hover {
|
||||
background: #282A2E;
|
||||
border: 1px solid #117743;
|
||||
border-radius: 5px;
|
||||
font-size: 10pt;
|
||||
background: #282A2E;
|
||||
border: 1px solid #117743;
|
||||
border-radius: 2px;
|
||||
font-size: 11pt;
|
||||
}
|
||||
|
||||
/* OPTIONS */
|
||||
#options_div, #alert_div {
|
||||
background: #1D1F21;
|
||||
border: 1px dashed #117743;
|
||||
background: #1D1F21;
|
||||
border: 1px dashed #117743;
|
||||
}
|
||||
#options_tablist {
|
||||
border-right: 1px dashed #117743;
|
||||
border-right: 1px dashed #117743;
|
||||
}
|
||||
.options_tab_icon {
|
||||
color: #ACACAC;
|
||||
color: #ACACAC;
|
||||
}
|
||||
.options_tab_icon.active {
|
||||
color: #FFB300;
|
||||
color: #FFB300;
|
||||
}
|
||||
|
||||
/* FIXES */
|
||||
div.ban {
|
||||
background: #1D1F21;
|
||||
background: #1D1F21;
|
||||
border: 1px dashed #117743;
|
||||
}
|
||||
|
||||
|
@ -225,7 +261,7 @@ table thead th {
|
|||
}
|
||||
|
||||
.theme-catalog .thread .meta {
|
||||
font-size: 10pt;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.theme-catalog .thread.grid-size-small .replies {
|
||||
|
|