Merge branch 'config' into defer_javascript
This commit is contained in:
commit
6d53814a90
|
@ -312,7 +312,7 @@ class ImageConvert extends ImageBase {
|
||||||
$this->destroy();
|
$this->destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->temp = tempnam($config['tmp'], 'convert');
|
$this->temp = tempnam($config['tmp'], 'convert') . ($config['thumb_ext'] == '' ? '' : '.' . $config['thumb_ext']);
|
||||||
|
|
||||||
$config['thumb_keep_animation_frames'] = (int)$config['thumb_keep_animation_frames'];
|
$config['thumb_keep_animation_frames'] = (int)$config['thumb_keep_animation_frames'];
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,15 @@ $config['max_images'] = 5;
|
||||||
$config['image_reject_repost'] = false;
|
$config['image_reject_repost'] = false;
|
||||||
|
|
||||||
$config['thumb_method'] = 'gm+gifsicle';
|
$config['thumb_method'] = 'gm+gifsicle';
|
||||||
|
$config['thumb_ext'] = 'webp';
|
||||||
$config['gnu_md5'] = '1';
|
$config['gnu_md5'] = '1';
|
||||||
|
|
||||||
|
|
||||||
|
// Strip EXIF metadata from JPEG files.
|
||||||
|
$config['strip_exif'] = true;
|
||||||
|
// Use the command-line `exiftool` tool to strip EXIF metadata without decompressing/recompressing JPEGs.
|
||||||
|
$config['use_exiftool'] = true;
|
||||||
|
|
||||||
// $config['update_on_posts'] = true;
|
// $config['update_on_posts'] = true;
|
||||||
$config['referer_match'] = false;
|
$config['referer_match'] = false;
|
||||||
|
|
||||||
|
@ -386,7 +394,6 @@ $config['additional_javascript'][] = 'js/file-selector.js';
|
||||||
$config['additional_javascript'][] = 'js/save-user_flag.js';
|
$config['additional_javascript'][] = 'js/save-user_flag.js';
|
||||||
$config['additional_javascript'][] = 'js/webm-settings.js';
|
$config['additional_javascript'][] = 'js/webm-settings.js';
|
||||||
$config['additional_javascript'][] = 'js/expand-video.js';
|
$config['additional_javascript'][] = 'js/expand-video.js';
|
||||||
$config['additional_javascript'][] = 'js/download-original.js';
|
|
||||||
|
|
||||||
$config['flag_preview'] = true;
|
$config['flag_preview'] = true;
|
||||||
|
|
||||||
|
@ -449,16 +456,16 @@ $config['markup'][] = array("/~~(.+?)~~/", "<span class=\"strikethrough\">\$1</s
|
||||||
* https://regex101.com/r/31wYx0/2
|
* https://regex101.com/r/31wYx0/2
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
$a_alias = 'a4@ÁÀȦÂÄǞǍĂĀÃÅǺǼǢáàȧâäǟǎăāãåǻǽǣĄĄ̊ąą̊æɑÆⱭ';
|
$a_alias = 'a4@ÁÀȦÂÄǞǍĂĀÃÅǺǼǢáàȧâäǟǎăāãåǻǽǣĄĄ̊ąą̊æɑÆⱭАа';
|
||||||
$g_alias = 'gǵġĝǧğǥɠǤƓǴĠĜǦĞĢ';
|
$g_alias = 'gǵġĝǧğǥɠǤƓǴĠĜǦĞĢ';
|
||||||
$i_alias = 'i1L||ıɩįɨɨ̧ĮƗƗ̧íìîïǐĭīĩịÍÌİÎÏǏĬĪĨỊĺļľŀḷḽ';
|
$i_alias = 'i1L||ıɩįɨɨ̧ĮƗƗ̧íìîïǐĭīĩịÍÌİÎÏǏĬĪĨỊĺļľŀḷḽІії';
|
||||||
$n_alias = 'nŋʼnńṅňñņṋŃṄŇÑŅṊ';
|
$n_alias = 'nŋʼnńṅňñņṋŃṄŇÑŅṊ';
|
||||||
|
|
||||||
$config['wordfilters'][] = array('/TRANN(Y|IE)?/', 'TRANSHUMANIST', true);
|
$config['wordfilters'][] = array('/TRANN(Y|IE)?/', 'TRANSHUMANIST', true);
|
||||||
$config['wordfilters'][] = array('/NIGGA/', 'UYGHA', true);
|
$config['wordfilters'][] = array('/NIGGA/', 'UYGHA', true);
|
||||||
$config['wordfilters'][] = array('/NIGGER/', 'UYGHUR', true);
|
$config['wordfilters'][] = array('/NIGGER/', 'UYGHUR', true);
|
||||||
$config['wordfilters'][] = array("/t[^\p{L}0-9]*r+[^\p{L}0-9]*[$a_alias]+[^\p{L}0-9]*[$n_alias]+[^\p{L}0-9]*[$n_alias]+[^\p{L}0-9]*(y|[$i_alias]+[^\p{L}0-9]*[e3]+)?/imu", 'transhumanist', true);
|
$config['wordfilters'][] = array("/t[^\p{L}0-9]*r+[^\p{L}0-9]*[$a_alias]+[^\p{L}0-9]*[$n_alias]+[^\p{L}0-9]*[$n_alias]+[^\p{L}0-9]*(y|[$i_alias]+[^\p{L}0-9]*[e3е]+)?/imu", 'transhumanist', true);
|
||||||
$config['wordfilters'][] = array("/[$n_alias][^\p{L}0-9]*[$i_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[e3]+[^\p{L}0-9]*r/imu", 'uyghur', true);
|
$config['wordfilters'][] = array("/[$n_alias][^\p{L}0-9]*[$i_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[e3е]+[^\p{L}0-9]*r/imu", 'uyghur', true);
|
||||||
$config['wordfilters'][] = array("/[$n_alias][^\p{L}0-9]*[$i_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[$g_alias]+/imu", 'uygh', true);
|
$config['wordfilters'][] = array("/[$n_alias][^\p{L}0-9]*[$i_alias]+[^\p{L}0-9]*[$g_alias]+[^\p{L}0-9]*[$g_alias]+/imu", 'uygh', true);
|
||||||
$config['wordfilters'][] = array('/ewish uyghur/i', 'ewish nigger', true);
|
$config['wordfilters'][] = array('/ewish uyghur/i', 'ewish nigger', true);
|
||||||
|
|
||||||
|
@ -492,30 +499,25 @@ $config['filters'][] = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Filters for diverting TheThingN0ticer ban evader
|
* Filter TheThingN0ticer ban evader
|
||||||
*/
|
*/
|
||||||
$fakereason_thing = 'Due to automated child pornography and gore spam by /pol/, all posting now requires a pass.<br>To receive a one-week pass, email a short explanation of the Labor Theory of Value to space@national.shitposting.agency .';
|
event_handler('post', function($post, $tor) {
|
||||||
event_handler('post', function($post) {
|
if($post->board == 'leftypol'){
|
||||||
$fakereason_thing = 'Due to automated child pornography and gore spam by /pol/, all posting now requires a pass.<br>To receive a one-week pass, email a short explanation of the Labor Theory of Value to space@national.shitposting.agency .';
|
// note: just posting nazi flag with name doesn't trigger, on purpose
|
||||||
|
$n = 0;
|
||||||
|
// body is just a twitter account (or has ?lang=en or something)
|
||||||
|
if(preg_match('/^(https:\/\/)?(www.|m(obile)?.)?twitter\.com\/[a-zA-Z0-9_-]+\/?[#?&a-zA-Z0-9=_-]*(<tinyboard[^>]*>[^<]*<\/tinyboard>|<[^>]*>|\s)*$/',
|
||||||
|
$post->body_nomarkup)){$n+=2;}
|
||||||
|
if($post->has_file && preg_match('/^Untitled[0-9]*.png/', $post->files[0]->filename)){$n+=2;}
|
||||||
|
if($post->name != 'Anonymous'){$n++; if($post->name == 'NasheedsSeedAndFeed'){$n+=2;}}
|
||||||
|
if(strpos($post->body_nomarkup,'<tinyboard flag>nazi</tinyboard>')){$n++;}
|
||||||
|
|
||||||
// Detects posts in the /ITG/ with the filename "Untitled.png" and a Nazi flag
|
if($n > 2){
|
||||||
if (!$post->op && $post->board == 'leftypol' && $post->thread == 110463 && $post->has_file &&
|
if($tor){return 'Flood detected; Post discarded.';}
|
||||||
$post->files[0]->filename == 'Untitled.png' &&
|
return 'Your IP address is listed in multirbl or rbl.efnetrbl.org.';
|
||||||
strpos($post->body_nomarkup, "Nazi</tinyboard>") !== false) { /* has Nazi flag, hack */
|
}
|
||||||
return $fakereason_thing;
|
|
||||||
// Detects posts with the Nazi flag and their favorite Twitter links
|
|
||||||
} else if (strpos($post->body_nomarkup, "Nazi</tinyboard>") !== false && /* has Nazi flag, hack */
|
|
||||||
preg_match('/\/(WokeCapital|NickJFuentes|af_clips)/', $post->body)) {
|
|
||||||
return $fakereason_thing;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$config['filters'][] = array(
|
|
||||||
'condition' => array(
|
|
||||||
'name' => '/Chauvinist/', // Current name as of April.
|
|
||||||
),
|
|
||||||
'action' => 'reject',
|
|
||||||
'message' => $fakereason_thing
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Changes made via web editor by "zul_admin" @ Fri, 19 Feb 2021 15:06:33 -0800:
|
// Changes made via web editor by "zul_admin" @ Fri, 19 Feb 2021 15:06:33 -0800:
|
||||||
|
|
|
@ -14,8 +14,46 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function() {
|
||||||
var stylesDiv = $('div.styles');
|
var stylesDiv = $('div.styles');
|
||||||
|
var pages = $('div.pages');
|
||||||
|
var stylesSelect = $('<select></select>').css({float:"none"});
|
||||||
|
var options = [];
|
||||||
|
|
||||||
|
var i = 1;
|
||||||
|
stylesDiv.children().each(function() {
|
||||||
|
var name = this.innerHTML.replace(/(^\[|\]$)/g, '');
|
||||||
|
var opt = $('<option></option>')
|
||||||
|
.html(name)
|
||||||
|
.val(i);
|
||||||
|
if ($(this).hasClass('selected'))
|
||||||
|
opt.attr('selected', true);
|
||||||
|
options.push ([name.toUpperCase (), opt]);
|
||||||
|
$(this).attr('id', 'style-select-' + i);
|
||||||
|
i++;
|
||||||
|
});
|
||||||
|
|
||||||
|
options.sort ((a, b) => {
|
||||||
|
const keya = a [0];
|
||||||
|
const keyb = b [0];
|
||||||
|
if (keya < keyb) { return -1; }
|
||||||
|
if (keya > keyb) { return 1; }
|
||||||
|
return 0;
|
||||||
|
}).forEach (([key, opt]) => {
|
||||||
|
stylesSelect.append(opt);
|
||||||
|
});
|
||||||
|
|
||||||
|
stylesSelect.change(function() {
|
||||||
|
$('#style-select-' + $(this).val()).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
stylesDiv.hide()
|
||||||
|
pages.after(
|
||||||
|
$('<div id="style-select"></div>')
|
||||||
|
.append(_('Select theme: '), stylesSelect)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
stylesDiv = $('div.styles');
|
||||||
var pages = $('div.pages');
|
var pages = $('div.pages');
|
||||||
var stylesSelect = $('<select></select>');
|
var stylesSelect = $('<select></select>');
|
||||||
|
|
||||||
|
@ -43,3 +81,4 @@ $(document).ready(function(){
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
5
post.php
5
post.php
|
@ -1295,10 +1295,13 @@ function handle_post(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Custom /leftypol/ var to check if Tor
|
||||||
|
$tor = ($_SERVER['REMOTE_ADDR'] == '127.0.0.1');
|
||||||
|
|
||||||
$post = (object)$post;
|
$post = (object)$post;
|
||||||
$post->files = array_map(function($a) { return (object)$a; }, $post->files);
|
$post->files = array_map(function($a) { return (object)$a; }, $post->files);
|
||||||
|
|
||||||
$error = event('post', $post);
|
$error = event('post', $post, $tor);
|
||||||
$post->files = array_map(function($a) { return (array)$a; }, $post->files);
|
$post->files = array_map(function($a) { return (array)$a; }, $post->files);
|
||||||
|
|
||||||
if ($error) {
|
if ($error) {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 14 KiB |
49
status.php
49
status.php
|
@ -2,8 +2,55 @@
|
||||||
|
|
||||||
require_once 'inc/functions.php';
|
require_once 'inc/functions.php';
|
||||||
|
|
||||||
|
function endsWith( $haystack, $needle ) {
|
||||||
|
$length = strlen( $needle );
|
||||||
|
if( !$length ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return substr( $haystack, -$length ) === $needle;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Boards that are nsfw
|
||||||
|
$nsfw_boards = ['b', 'overboard'];
|
||||||
|
// Boards that use spoiler_alunya.png as their spoiler
|
||||||
|
$alunya_spoiler = ['leftypol', 'anime'];
|
||||||
|
// Boards where posts are not allowed to be created
|
||||||
|
$readonly_boards = ['overboard', 'sfw', 'alt'];
|
||||||
|
|
||||||
|
$board_list = listBoards();
|
||||||
|
|
||||||
|
// Add objects that are not boards but are treated as such
|
||||||
|
$board_list[] = ['uri' => 'overboard', 'title' => 'Overboard'];
|
||||||
|
$board_list[] = ['uri' => 'sfw', 'title' => 'SFW Overboard'];
|
||||||
|
$board_list[] = ['uri' => 'alt', 'title' => 'Alternate Overboard'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allowed fields for the board object:
|
||||||
|
* - code<string>: The board code ('b', 'tech', ...)
|
||||||
|
* - name<string>: The board user-readable name ('Siberia', ...)
|
||||||
|
* - description<string>: The board description ('Leftist Politically Incorrect', ...)
|
||||||
|
* - sfw<boolean>: Is this board sfw?
|
||||||
|
* - alternate_spoilers<boolean>: Does this board use the alunya spoiler?
|
||||||
|
*/
|
||||||
|
$boards = [];
|
||||||
|
foreach ($board_list as $board) {
|
||||||
|
// Skip archives
|
||||||
|
if (endsWith($board['uri'], '_archive')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$boards[] = [
|
||||||
|
'code' => $board['uri'],
|
||||||
|
'name' => $board['title'],
|
||||||
|
'sfw' => !in_array($board['uri'], $nsfw_boards),
|
||||||
|
'alternate_spoilers' => in_array($board['uri'], $alunya_spoiler),
|
||||||
|
'posting_enabled' => !in_array($board['uri'], $readonly_boards),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'captcha' => $config['securimage'],
|
'captcha' => $config['securimage'],
|
||||||
'flags' => $config['user_flags']
|
'flags' => $config['user_flags'],
|
||||||
|
'boards' => $boards,
|
||||||
]);
|
]);
|
|
@ -22,9 +22,9 @@
|
||||||
{% if config.show_filename and file.filename %}
|
{% if config.show_filename and file.filename %}
|
||||||
,
|
,
|
||||||
{% if file.filename|length > config.max_filename_display %}
|
{% if file.filename|length > config.max_filename_display %}
|
||||||
<span class="postfilename" title="{{ file.filename|e|bidi_cleanup }}">{{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }}</span>
|
<a href="{{ config.uri_img }}{{ file.file }}" download="{{ file.filename }}" title="Save as original filename">{{ file.filename|truncate_filename(config.max_filename_display)|e|bidi_cleanup }}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="postfilename">{{ file.filename|e|bidi_cleanup }}</span>
|
<a href="{{ config.uri_img }}{{ file.file }}" download="{{ file.filename }}" title="Save as original filename">{{ file.filename|e|bidi_cleanup }}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
)
|
)
|
||||||
|
@ -36,3 +36,4 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue