From e87b60799b2d6f5771502d0cc6aa78b0436375d0 Mon Sep 17 00:00:00 2001
From: 8n-tech <8n-tech@users.noreply.github.com>
Date: Thu, 28 May 2015 05:50:47 +1000
Subject: [PATCH 01/10] #501 Resolved case sensitivity in the board search.
---
board-search.php | 11 ++++++++---
inc/functions.php | 2 +-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/board-search.php b/board-search.php
index 484467b4..07bf8c88 100644
--- a/board-search.php
+++ b/board-search.php
@@ -55,6 +55,11 @@ if (isset( $_GET['tags'] ) && $_GET['tags'] != "") {
}
$search['tags'] = array_splice( $search['tags'], 0, 5 );
+
+ foreach ($search['tags'] as &$tag)
+ {
+ $tag = strtolower( $tag );
+ }
}
// What time range?
@@ -64,7 +69,7 @@ if (isset( $_GET['time'] ) && is_numeric( $_GET['time'] ) ) {
// Include what in the uri / title / subtitle?
if (isset( $_GET['title'] ) && $_GET['title'] != "") {
- $search['title'] = $_GET['title'];
+ $search['title'] = strtolower( $_GET['title'] );
}
/* Search boards */
@@ -92,10 +97,10 @@ foreach ($boards as $board) {
if (strpos("/{$board['uri']}/", $search['title']) !== false) {
$board['weight'] = 30;
}
- else if (strpos($board['title'], $search['title']) !== false) {
+ else if (strpos(strtolower($board['title']), $search['title']) !== false) {
$board['weight'] = 20;
}
- else if (strpos($board['subtitle'], $search['title']) !== false) {
+ else if (strpos(strtolower($board['subtitle']), $search['title']) !== false) {
$board['weight'] = 10;
}
else {
diff --git a/inc/functions.php b/inc/functions.php
index 3c8b2366..d2161993 100755
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1019,7 +1019,7 @@ function fetchBoardTags( $uris ) {
$boardTags[ $tagRow['uri'] ] = array();
}
- $boardTags[ $tagRow['uri'] ][] = $tag;
+ $boardTags[ $tagRow['uri'] ][] = strtolower( $tag );
}
}
From 6a04623eac11e40a2a846e7a0aeb5c323644950e Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:21:49 -0700
Subject: [PATCH 02/10] allow caps in captcha
---
8chan-captcha/entrypoint.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/8chan-captcha/entrypoint.php b/8chan-captcha/entrypoint.php
index 213ddb6f..26849939 100644
--- a/8chan-captcha/entrypoint.php
+++ b/8chan-captcha/entrypoint.php
@@ -54,7 +54,7 @@ case "check":
$query = prepare("DELETE FROM `captchas` WHERE `cookie` = ? AND `extra` = ?");
$query->execute([$_GET['cookie'], $_GET['extra']]);
- if ($ary[0]['text'] !== $_GET['text']) {
+ if (strtolower($ary[0]['text']) !== strtolower($_GET['text'])) {
echo "0";
}
else {
From 6066ff4c6aeebcda4e5ae19948b680df1016571a Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:21:57 -0700
Subject: [PATCH 03/10] Update FAQ
---
faq.php | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/faq.php b/faq.php
index a3f4cc88..35408d3f 100644
--- a/faq.php
+++ b/faq.php
@@ -70,12 +70,14 @@ $body = <<Make sure you are using the volunteer interface to view your board. The URL of your browser should be https://8ch.net/mod.php?/yourboard.
If you are the owner of the board, put "## Board Owner" in the name field. If someone else is the owner and you are just assisting them, put "## Board Volunteer" in the name field. Write your post and click "Reply". It will appear with your capcode.
-
Help! The owner of X board is doing something I don't like!
-
If they aren't doing anything illegal, I can't help you. I don't dictate how board owners should manage their boards.
-
If they are doing something illegal, email me.
-
-
Can you give me X board?
-
If the owner of the board is inactive or the board is broken due to bad CSS, sure. Send me an email. You can see a list of boards that qualify for being taken over here.
+
Help! The owner of X board is doing something I don't like! Can I have X board?
+
If they aren't doing anything illegal, I can't help you. I don't dictate how board owners should manage their boards outside of a few conditions:
+
+
the board owner nukes the board either by deleting all the posts or banning so much IP space hardly anyone can post
+
the board owner implements CSS which makes posting impossible or very difficult, and someone wants to use the board name for something else
+
the board owner allows illegal content to be posted, or states in the rules that the global rule doesn't apply
+
+
If they are, email me.
Can you add some new feature?
Open a Github issue. Better yet, write it yourself and open a pull request.
@@ -164,9 +166,8 @@ Assuming the /b/ board, they are as follows:
The current key fingerprint is 6F12 EC72 A82A BCA3 5235 063A 10DD C983 901A A183.
How do I donate?
-
Donations can be sent to 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C (Bitcoin) or LUPgSCJt3iGeJXUETVhmnbQ89Riaq1yjZm (Litecoin).
+
Donations can be sent to 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C (Bitcoin) or LgNczzSm64C3BmaXyFVQnM3PvcmSd196f6 (Litecoin).
I am also a big fan of Monero (XMR). You can send XMR to our OpenAlias in the simplewallet client, or simply send to 49dBJhGhYFxJEfydS6hH6GRyg1W4cDgupdNVtw7j1WtcUY7xPXwNLw6fUVay644viaCcEhMFG1Z7SjjxRXEFDdNWJdvH9kS.
-
If you would like to support development of the engine that 8chan runs on (infinity), you may also .
Are you really a cripple?
Yes.
From 8bf7e143b1c16eeee4ca414c3405d8cae3713eeb Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:22:34 -0700
Subject: [PATCH 04/10] Trial tor images option
---
inc/8chan-mod-pages.php | 10 +++++++++-
post.php | 6 +++---
templates/mod/settings.html | 6 ++++--
3 files changed, 16 insertions(+), 6 deletions(-)
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 @@
{% trans %}Automatically convert ... to …{% endtrans %}
{% trans %}Disallow combining characters ("Zalgo", Vietnamese text){% endtrans %}
{% trans %}No index{% endtrans %} {% trans %}Hide from boards index and do not index in search engines{% endtrans %}
-
{% trans %}Archive my board on 8archive.moe{% endtrans %} {% trans %}This archives your board on 8archive.moe if you opt in{% endtrans %}
+
{% trans %}Archive my board on 8archive.moe{% endtrans %} {% trans %}This archives your board on 8archive.moe if you opt in (broken at the moment){% endtrans %}
{% trans %}[code] tags{% endtrans %}
{% trans %}Oekaki{% endtrans %}
{% trans %}Format math between $${% endtrans %}
@@ -52,7 +52,9 @@
{% trans %}Don't allow users to repost images (whole board){% endtrans %}
{% trans %}Don't allow users to repost images (same thread){% endtrans %}
{% trans %}Allow a poster to delete his own posts{% endtrans %}
-
{% trans %}Allow posters to post via the Tor onion router{% endtrans %} Disabling this is evil, but if you really care about "ban evasion", here you go.
+
{% trans %}Allow posters to see when a thread is bumplocked{% endtrans %}
+
{% trans %}Allow posters to post via the Tor onion router{% endtrans %}
+
{% trans %}Allow posters to post upload files via Tor (trial){% endtrans %}
{% trans %}Enable CAPTCHA{% endtrans %} Users must solve a CAPTCHA in order to post. This is not ReCAPTCHA, it is custom to 8chan.
{% trans %}Enable CAPTCHA for thread creation only{% endtrans %} Users must solve a CAPTCHA in order to create new threads, but do not have to solve a CAPTCHA in order to post replies.
{% trans %}Public bans{% endtrans %} {% trans %}Displays your bans for the public{% endtrans %}
From 01c44a2e935fce786b9e77bd4de1439703d2093a Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:23:22 -0700
Subject: [PATCH 05/10] Bug fixes: unserialize() failed with very long arrays
due to mysql cutoff (flood) .. strip_combining_characters missed a few spots
---
inc/functions.php | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/inc/functions.php b/inc/functions.php
index 3c8b2366..12bd57bf 100755
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -951,7 +951,9 @@ function fetchBoardActivity( array $uris = array(), $forTime = false, $detailed
}
// Set the active posters as the unserialized array.
- $boardActivity['active'][$bsRow['stat_uri']] = unserialize( $bsRow['author_ip_array'] );
+ $uns = @unserialize($bsRow['author_ip_array']);
+ if (!$uns) continue;
+ $boardActivity['active'][$bsRow['stat_uri']] = $uns;
// Start the average PPH off at the current post count.
$boardActivity['average'][$bsRow['stat_uri']] = $bsRow['post_count'];
}
@@ -970,7 +972,9 @@ function fetchBoardActivity( array $uris = array(), $forTime = false, $detailed
}
// Merge our active poster arrays. Unique counting is done below.
- $boardActivity['active'][$bsRow['stat_uri']] = array_merge( $boardActivity['active'][$bsRow['stat_uri']], unserialize( $bsRow['author_ip_array'] ) );
+ $uns = @unserialize($bsRow['author_ip_array']);
+ if (!$uns) continue;
+ $boardActivity['active'][$bsRow['stat_uri']] = array_merge( $boardActivity['active'][$bsRow['stat_uri']], $uns );
// Add our post count to the average. Averaging is done below.
$boardActivity['average'][$bsRow['stat_uri']] += $bsRow['post_count'];
}
@@ -2553,7 +2557,7 @@ function strip_combining_chars($str) {
$o = 0;
$ord = ordutf8($char, $o);
- if ( ($ord >= 768 && $ord <= 879) || ($ord >= 7616 && $ord <= 7679) || ($ord >= 8400 && $ord <= 8447) || ($ord >= 65056 && $ord <= 65071)){
+ if ( ($ord >= 768 && $ord <= 879) || ($ord >= 1750 && $ord <= 1773) || ($ord >= 3655 && $ord <= 3659) || ($ord >= 7616 && $ord <= 7679) || ($ord >= 8400 && $ord <= 8447) || ($ord >= 65056 && $ord <= 65071)){
continue;
}
From 7410d6ef1f3ea825d05833fede0f8531fae555cb Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:23:40 -0700
Subject: [PATCH 06/10] Surely no one can make an 8mb webm longer than 2 hours
---
inc/instance-config.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inc/instance-config.php b/inc/instance-config.php
index 14ba4833..2aa2ecf8 100644
--- a/inc/instance-config.php
+++ b/inc/instance-config.php
@@ -58,7 +58,7 @@
$config['allowed_ext_files'][] = 'mp4';
$config['webm']['use_ffmpeg'] = true;
$config['webm']['allow_audio'] = true;
- $config['webm']['max_length'] = 60 * 30;
+ $config['webm']['max_length'] = 60 * 120;
// Mod shit
$config['mod']['groups'][25] = 'GlobalVolunteer';
From fa0d1a337e83c2fc6c9a0b9780d79edba8df539b Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:24:24 -0700
Subject: [PATCH 07/10] Tweak announcement style
---
stylesheets/style.css | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/stylesheets/style.css b/stylesheets/style.css
index 1c33f5d0..3865e3f7 100644
--- a/stylesheets/style.css
+++ b/stylesheets/style.css
@@ -1657,8 +1657,8 @@ td.board-tags a.tag-link {
.announcement {
font-size: 75%;
padding-bottom: 1%;
- margin-left: 25%;
- margin-right: 25%;
+ margin-left: 5%;
+ margin-right: 5%;
}
/* Gallery view */
From d5955146fde76c84a9d90da3b976d1eb0d617dbd Mon Sep 17 00:00:00 2001
From: 8chan
Date: Thu, 28 May 2015 21:24:48 -0700
Subject: [PATCH 08/10] I hope I can revert this 24 hour captcha forf everyone
soon...
---
templates/8chan/dnsbls.html | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/templates/8chan/dnsbls.html b/templates/8chan/dnsbls.html
index 0e346a00..ae447923 100644
--- a/templates/8chan/dnsbls.html
+++ b/templates/8chan/dnsbls.html
@@ -1,8 +1,6 @@