From fa98aa1dbb8412a45ef3adeab6af0b70a52edfb7 Mon Sep 17 00:00:00 2001 From: NekoCH <96158157+ex-hentai@users.noreply.github.com> Date: Sun, 14 May 2023 16:57:26 +0800 Subject: [PATCH 1/6] fix router script entrance (cherry picked from commit 25194a47e74dcd6d2d2c8451fc509ff3668151fa) --- server.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.php b/server.php index 5fb6379e..6ae40f5f 100644 --- a/server.php +++ b/server.php @@ -18,4 +18,4 @@ if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { return false; } -require_once __DIR__.'/public/index.php'; +require_once __DIR__.'/public/nexus.php'; From 75df66e6f0c290dc67094010a7371ca387d1bbde Mon Sep 17 00:00:00 2001 From: NekoCH <96158157+ex-hentai@users.noreply.github.com> Date: Sun, 14 May 2023 18:49:35 +0800 Subject: [PATCH 2/6] fix database charset (cherry picked from commit ccfd815ebd65134817341c18adc47fc54a710806) --- nexus/Database/DBMysqli.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nexus/Database/DBMysqli.php b/nexus/Database/DBMysqli.php index 1f04d053..c1d6dc56 100644 --- a/nexus/Database/DBMysqli.php +++ b/nexus/Database/DBMysqli.php @@ -12,8 +12,8 @@ class DBMysqli implements DBInterface if (mysqli_connect_errno()) { throw new DatabaseException(mysqli_connect_error()); } - $mysqli->query("SET NAMES UTF8"); - $mysqli->query("SET collation_connection = 'utf8_general_ci'"); + $mysqli->set_charset("utf8mb4"); + $mysqli->query("SET collation_connection = 'utf8mb4_unicode_ci'"); $mysqli->query("SET sql_mode=''"); $mysqli->query("SET time_zone='".date('P')."'"); From d72546cb145efc8bd624ac77d0dedd05e5c89e93 Mon Sep 17 00:00:00 2001 From: NekoCH <96158157+ex-hentai@users.noreply.github.com> Date: Mon, 15 May 2023 10:41:49 +0800 Subject: [PATCH 3/6] fix close all tag (cherry picked from commit 44acb96107c9b6498da07f09175cdf791265c420) --- include/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 4ba9192c..6c319e2b 100644 --- a/include/functions.php +++ b/include/functions.php @@ -818,7 +818,7 @@ function closeall() { tagRemove = popstack(bbtags) if ( (tagRemove != 'color') ) { doInsert("[/"+tagRemove+"]", "", false); - eval("document.." + tagRemove + ".value = ' " + tagRemove + " '"); + eval("document.." + tagRemove + ".value = ' " + tagRemove.toUpperCase() + " '"); eval(tagRemove + "_open = 0"); } else { doInsert("[/"+tagRemove+"]", "", false); From b6a566bdd55d89218b11f562ab9856a7e199a54f Mon Sep 17 00:00:00 2001 From: NekoCH <96158157+ex-hentai@users.noreply.github.com> Date: Tue, 23 May 2023 15:56:28 +0800 Subject: [PATCH 4/6] resample uploaded images instead of resize (cherry picked from commit 7dcc41765313b1b097efa86d4a99fc8787b2c464) --- public/attachment.php | 2 +- public/bitbucket-upload.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/attachment.php b/public/attachment.php index c70d3d04..a2290dfb 100644 --- a/public/attachment.php +++ b/public/attachment.php @@ -109,7 +109,7 @@ if ($Attach->enable_attachment()) if ($orig && !$stop) { $thumb = imagecreatetruecolor($newwidth, $newheight); - imagecopyresized($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); if ($thumbnailtype_attachment == 'createthumb'){ $hasthumb = true; imagejpeg($thumb, $file_location.".".$ext.".thumb.jpg", $thumbquality_attachment); diff --git a/public/bitbucket-upload.php b/public/bitbucket-upload.php index bcbfb7b7..da598450 100644 --- a/public/bitbucket-upload.php +++ b/public/bitbucket-upload.php @@ -48,7 +48,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") if(!$orig) stderr($lang_bitbucketupload['std_image_processing_failed'],$lang_bitbucketupload['std_sorry_the_uploaded']."$imgtypes[$it]".$lang_bitbucketupload['std_failed_processing']); $thumb = imagecreatetruecolor($newwidth, $newheight); - imagecopyresized($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); switch ($it) { case 1: $ret = imagegif($thumb, $tgtfile); From 51be17e4b66c7cf0be8b0ed8178446d6e0197eef Mon Sep 17 00:00:00 2001 From: NekoCH <96158157+ex-hentai@users.noreply.github.com> Date: Fri, 7 Jul 2023 16:31:38 +0800 Subject: [PATCH 5/6] insert search suggestion only when results are found (cherry picked from commit 382c779a5f9b2de74b18af8724516f79d266c3cf) --- public/torrents.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/torrents.php b/public/torrents.php index ee11320c..4a621e88 100644 --- a/public/torrents.php +++ b/public/torrents.php @@ -702,7 +702,6 @@ $search_area = 0; if (isset($searchstr)) { if (!isset($_GET['notnewword']) || !$_GET['notnewword']){ - insert_suggest($searchstr, $CURUSER['id']); $notnewword=""; } else{ @@ -956,6 +955,9 @@ do_log("[TORRENT_COUNT_SQL] $sql", 'debug'); if ($count) { + if (isset($searchstr) && (!isset($_GET['notnewword']) || !$_GET['notnewword'])){ + insert_suggest($searchstr, $CURUSER['id']); + } if ($addparam != "") { if ($pagerlink != "") From 2cc057ce93450199cede8a7a52be8822bc5b4671 Mon Sep 17 00:00:00 2001 From: ex-hentai <96158157+ex-hentai@users.noreply.github.com> Date: Thu, 3 Aug 2023 22:28:01 +0800 Subject: [PATCH 6/6] group peers by ip --- public/userdetails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/userdetails.php b/public/userdetails.php index 5cd20215..830e2a44 100644 --- a/public/userdetails.php +++ b/public/userdetails.php @@ -238,7 +238,7 @@ if (user_can('userprofile') || $user["id"] == $CURUSER["id"]) tr_small($lang_userdetails['row_ip_address'], $user['ip'].$locationinfo.$seedBoxIcon, 1); } $clientselect = ''; -$res = sql_query("SELECT peer_id, agent, ipv4, ipv6, port FROM peers WHERE userid = {$user['id']} GROUP BY agent") or sqlerr(); +$res = sql_query("SELECT peer_id, agent, ipv4, ipv6, port FROM peers WHERE userid = {$user['id']} GROUP BY agent, ipv4, ipv6, port") or sqlerr(); if (mysql_num_rows($res) > 0) { $clientselect .= "";
AgentIPV4IPV6Port