Revert "Fixed info hash v2 issue (#233)"

This reverts commit 474f51185c.
This commit is contained in:
Roman Kelesidis 2023-09-03 11:29:22 +07:00
parent 474f51185c
commit c1e995e4d5
3 changed files with 2 additions and 11 deletions

View File

@ -6,7 +6,6 @@
**Merged pull requests:** **Merged pull requests:**
- Release v2.1.5-2023.08 🎉 - Release v2.1.5-2023.08 🎉
- Fixed info hash v2 issue [\#233](https://github.com/torrentpier/torrentpier-lts/pull/233) ([belomaxorka](https://github.com/belomaxorka))
- BitTorrent v2 support 🐸 [\#230](https://github.com/torrentpier/torrentpier-lts/pull/230) ([belomaxorka](https://github.com/belomaxorka)) - BitTorrent v2 support 🐸 [\#230](https://github.com/torrentpier/torrentpier-lts/pull/230) ([belomaxorka](https://github.com/belomaxorka))
- Captcha improvements [\#229](https://github.com/torrentpier/torrentpier-lts/pull/229) ([belomaxorka](https://github.com/belomaxorka)) - Captcha improvements [\#229](https://github.com/torrentpier/torrentpier-lts/pull/229) ([belomaxorka](https://github.com/belomaxorka))
- Show renamed topic actions in log actions [\#227](https://github.com/torrentpier/torrentpier-lts/pull/227) ([belomaxorka](https://github.com/belomaxorka)) - Show renamed topic actions in log actions [\#227](https://github.com/torrentpier/torrentpier-lts/pull/227) ([belomaxorka](https://github.com/belomaxorka))

View File

@ -240,11 +240,7 @@ else
{ {
// Verify if torrent registered on tracker and user authorized // Verify if torrent registered on tracker and user authorized
$info_hash_sql = rtrim(DB()->escape($info_hash), ' '); $info_hash_sql = rtrim(DB()->escape($info_hash), ' ');
/** $info_hash_where = $is_bt_v2 ? "WHERE tor.info_hash_v2 = '$info_hash_sql'" : "WHERE tor.info_hash = '$info_hash_sql'";
* Поскольку торрент-клиенты в настоящее время обрезают инфо-хэш до 20 символов (независимо от его типа, как известно v1 = 20 символов, а v2 = 32 символа),
* то результатов $is_bt_v2 (исходя из длины строки определяем тип инфо-хэша) проверки нам будет мало, именно поэтому происходит поиск v2 хэша, если торрент является v1 (по длинне) и если в tor.info_hash столбце нету v1 хэша.
*/
$info_hash_where = $is_bt_v2 ? "WHERE tor.info_hash_v2 = '$info_hash_sql'" : "WHERE tor.info_hash = '$info_hash_sql' OR tor.info_hash_v2 LIKE '$info_hash_sql%'";
$passkey_sql = DB()->escape($passkey); $passkey_sql = DB()->escape($passkey);
$sql = " $sql = "

View File

@ -57,11 +57,7 @@ define('TR_ROOT', './');
require(TR_ROOT . 'includes/init_tr.php'); require(TR_ROOT . 'includes/init_tr.php');
$info_hash_sql = rtrim(DB()->escape($info_hash), ' '); $info_hash_sql = rtrim(DB()->escape($info_hash), ' ');
/** $info_hash_where = $is_bt_v2 ? "WHERE tor.info_hash_v2 = '$info_hash_sql'" : "WHERE tor.info_hash = '$info_hash_sql'";
* Поскольку торрент-клиенты в настоящее время обрезают инфо-хэш до 20 символов (независимо от его типа, как известно v1 = 20 символов, а v2 = 32 символа),
* то результатов $is_bt_v2 (исходя из длины строки определяем тип инфо-хэша) проверки нам будет мало, именно поэтому происходит поиск v2 хэша, если торрент является v1 (по длинне) и если в tor.info_hash столбце нету v1 хэша.
*/
$info_hash_where = $is_bt_v2 ? "WHERE tor.info_hash_v2 = '$info_hash_sql'" : "WHERE tor.info_hash = '$info_hash_sql' OR tor.info_hash_v2 LIKE '$info_hash_sql%'";
$row = DB()->fetch_row(" $row = DB()->fetch_row("
SELECT tor.complete_count, snap.seeders, snap.leechers SELECT tor.complete_count, snap.seeders, snap.leechers