From 9b6f40e06ecff2de412cffaeacf41abc478a0e6b Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 11 Jan 2023 18:37:02 +0000 Subject: [PATCH] updates --- core/imageboard/image.php | 4 ++++ ext/rule34/script.js | 9 ++++----- ext/tag_edit/main.php | 2 +- themes/rule34v2/header.inc | 20 ++++++++++---------- themes/rule34v2/home.theme.php | 15 +++++++++++++++ themes/rule34v2/page.class.php | 3 +-- 6 files changed, 35 insertions(+), 18 deletions(-) diff --git a/core/imageboard/image.php b/core/imageboard/image.php index 85b8410e..b381f6e8 100644 --- a/core/imageboard/image.php +++ b/core/imageboard/image.php @@ -76,6 +76,10 @@ class Image public static function by_id(int $id): ?Image { global $database; + if($id > 2**32) { + // for some reason bots query huge numbers and pollute the DB error logs... + return null; + } $row = $database->get_row("SELECT * FROM images WHERE images.id=:id", ["id"=>$id]); return ($row ? new Image($row) : null); } diff --git a/ext/rule34/script.js b/ext/rule34/script.js index b7d780a6..9d22a5e6 100644 --- a/ext/rule34/script.js +++ b/ext/rule34/script.js @@ -1,13 +1,12 @@ document.addEventListener('DOMContentLoaded', () => { - if(Cookies.get("ui-tnc-agreed") !== "true") { + if(Cookies.get("ui-tnc-agreed") !== "true" && window.location.href.indexOf("/wiki/") == -1) { $("BODY").addClass("censored"); $("BODY").append("
"); $("BODY").append(""+ "
"+ - "

For legal reasons, we need to point out that:"+ - "

A) this site contains material not suitable for minors"+ - "
B) cookies may be used"+ - "

Click here if you're an adult, and you're ok with that"+ + "

Cookies may be used. Please read our privacy policy for more information."+ + "

By accepting to enter you agree to our rules and terms of service."+ + "

Agree / Disagree"+ "

"+ ""); } diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index 8b9e34c9..69010372 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -38,7 +38,7 @@ class SourceSetEvent extends Event } -class TagSetException extends SCoreException +class TagSetException extends UserErrorException { public ?string $redirect; diff --git a/themes/rule34v2/header.inc b/themes/rule34v2/header.inc index a2570030..7b1fed9d 100644 --- a/themes/rule34v2/header.inc +++ b/themes/rule34v2/header.inc @@ -11,7 +11,7 @@  Sidebar  - logo + logo @@ -37,22 +37,22 @@ - - - + - + - + diff --git a/themes/rule34v2/home.theme.php b/themes/rule34v2/home.theme.php index 3cda2e09..065c56f9 100644 --- a/themes/rule34v2/home.theme.php +++ b/themes/rule34v2/home.theme.php @@ -31,6 +31,7 @@ class CustomHomeTheme extends HomeTheme #counter {display: none;} } + $body @@ -70,6 +71,20 @@ EOD + + + $contact_link Serving $num_comma posts – Running Shimmie2 diff --git a/themes/rule34v2/page.class.php b/themes/rule34v2/page.class.php index f2688da3..7dbd6053 100644 --- a/themes/rule34v2/page.class.php +++ b/themes/rule34v2/page.class.php @@ -125,8 +125,7 @@ EOD;
$flash_html - + $main_block_html