Transfer from array to ArrayObject data type (#1019)

This commit is contained in:
Cønstantine Kovalensky 2023-11-03 14:11:45 +04:00 committed by GitHub
commit 79116b2c27
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View file

@ -48,11 +48,14 @@ preg_match_all('/info_hash=([^&]*)/i', $_SERVER["QUERY_STRING"], $info_hash_arra
$info_hashes = [];
foreach ($info_hash_array[1] as $hash) {
if ($scrape_cache = CACHE('tr_cache')->get(SCRAPE_LIST_PREFIX . bin2hex(urldecode($hash)))) {
$decoded_hash = urldecode($hash);
if ($scrape_cache = CACHE('tr_cache')->get(SCRAPE_LIST_PREFIX . bin2hex($decoded_hash))) {
$torrents['files'][$info_key = array_key_first($scrape_cache)] = $scrape_cache[$info_key];
}
else{
$info_hashes[] = '\''. DB()->escape((urldecode($hash))) . '\'';
$info_hashes[] = '\''. DB()->escape(($decoded_hash)) . '\'';
}
}