mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 02:27:34 -07:00
refactor: Use DEFAULT_CHARSET
constant instead of hardcoded string (#2011)
This commit is contained in:
parent
c2e3a13a04
commit
7ac335974b
2 changed files with 4 additions and 4 deletions
|
@ -115,7 +115,7 @@ $stopped = ($event === 'stopped');
|
||||||
|
|
||||||
// Check info_hash length
|
// Check info_hash length
|
||||||
if (strlen($info_hash) !== 20) {
|
if (strlen($info_hash) !== 20) {
|
||||||
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -257,7 +257,7 @@ if ($lp_info) {
|
||||||
|
|
||||||
// Verify if torrent registered on tracker and user authorized
|
// Verify if torrent registered on tracker and user authorized
|
||||||
if (empty($row['topic_id'])) {
|
if (empty($row['topic_id'])) {
|
||||||
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
if (empty($row['user_id'])) {
|
if (empty($row['user_id'])) {
|
||||||
msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)');
|
msg_die('Please LOG IN and RE-DOWNLOAD this torrent (user not found)');
|
||||||
|
|
|
@ -32,7 +32,7 @@ $info_hash_hex = bin2hex($info_hash);
|
||||||
|
|
||||||
// Check info_hash length
|
// Check info_hash length
|
||||||
if (strlen($info_hash) !== 20) {
|
if (strlen($info_hash) !== 20) {
|
||||||
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
msg_die('Invalid info_hash: ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle multiple hashes
|
// Handle multiple hashes
|
||||||
|
@ -97,7 +97,7 @@ if (!empty($info_hash_count)) {
|
||||||
|
|
||||||
// Verify if torrent registered on tracker
|
// Verify if torrent registered on tracker
|
||||||
if (empty($torrents)) {
|
if (empty($torrents)) {
|
||||||
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, 'UTF8') ? $info_hash : $info_hash_hex));
|
msg_die('Torrent not registered, info_hash = ' . (mb_check_encoding($info_hash, DEFAULT_CHARSET) ? $info_hash : $info_hash_hex));
|
||||||
}
|
}
|
||||||
|
|
||||||
die(\Arokettu\Bencode\Bencode::encode($torrents));
|
die(\Arokettu\Bencode\Bencode::encode($torrents));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue