Hey everyone,
I'm trying to check against the parsed .torrent on torrents-upload.php as it fails to consider passkey in [color=rgb(251, 160, 38)]$site_config['announce_list'] [/color][color=rgb(204, 204, 204)]so anything we upload using our own announce url (our own domain), it fails to check
if it is anyway different from announce_list, which means uploads are ALWAYS flagged as "external" which they are not and hold no other backup trackers. Every line of config is in tact, and I take that file seriously.[/color]
I can not figure out for the life of me how to do a simple check on our domain against the array. Thrown maybe 6 different solutions at it, and no dice. var_dump is helpful but I just can't call my function correctly, or any other
way of doing this.
Problem:
Upload private torrent (with our announce url). Thinks it is external, and does just that. .torrent metadata confirmed. Makes no sense.
Desired Solution:
Upload a private torrent and see it as non-external. To not fail on domain validity (what the hell?)
I've tried:
And further on torrents-upload.php
CheckTracker() has had many different passes, with and without a variable. The function echo perfectly fine, both on false/true/string. How to pass it over to the array check??
true, false, string.. doesn't matter. It almost entirely ignores it.
See, I'm trying to bypass the announce_list config variable because thats how this started. So I'm trying to jump in before it checks that, to validate our announce url using preg_match(). Anyone know what I'm missing here?
The reason for all of this mess is because this does not work:
Because that parameter will never pass over, and lack of feedback on StackOverflow only adds to the mystery. Pissing me off.. does this line above even work for anybody?
I'm trying to check against the parsed .torrent on torrents-upload.php as it fails to consider passkey in [color=rgb(251, 160, 38)]$site_config['announce_list'] [/color][color=rgb(204, 204, 204)]so anything we upload using our own announce url (our own domain), it fails to check
if it is anyway different from announce_list, which means uploads are ALWAYS flagged as "external" which they are not and hold no other backup trackers. Every line of config is in tact, and I take that file seriously.[/color]
I can not figure out for the life of me how to do a simple check on our domain against the array. Thrown maybe 6 different solutions at it, and no dice. var_dump is helpful but I just can't call my function correctly, or any other
way of doing this.
Problem:
Upload private torrent (with our announce url). Thinks it is external, and does just that. .torrent metadata confirmed. Makes no sense.
Desired Solution:
Upload a private torrent and see it as non-external. To not fail on domain validity (what the hell?)
I've tried:
var_dump(CheckTracker());
function CheckTracker($domain){ // returns true on domain, or false on domain
$domain = "http://website.com/announce";
if (preg_match('{^http://[\w\.]*website.com/}i', $domain)) {
return true; // domain is a match from what is seen in .torrent in any pattern.
} else {
return false; // domain is a NOT match from what is seen in .torrent in any pattern.
}
// return; // <- this returns the full url of current page
}And further on torrents-upload.php
$TorrentInfo = array();
$TorrentInfo = ParseTorrent("$torrent_dir/$fname");
$announce = $TorrentInfo[0];
$infohash = $TorrentInfo[1];
$creationdate = $TorrentInfo[2];
$internalname = $TorrentInfo[3];
$torrentsize = $TorrentInfo[4];
$filecount = $TorrentInfo[5];
$annlist = $TorrentInfo[6];
$comment = $TorrentInfo[7];
$filelist = $TorrentInfo[8];
if (!in_array($announce, CheckTracker($annlist) === false)) {
$external = 'yes';
} else {
$external = 'no';
}
CheckTracker() has had many different passes, with and without a variable. The function echo perfectly fine, both on false/true/string. How to pass it over to the array check??
true, false, string.. doesn't matter. It almost entirely ignores it.
See, I'm trying to bypass the announce_list config variable because thats how this started. So I'm trying to jump in before it checks that, to validate our announce url using preg_match(). Anyone know what I'm missing here?
The reason for all of this mess is because this does not work:
site_config['PASSKEYURL'] = "$site_config[announce_list]?passkey=%s";Because that parameter will never pass over, and lack of feedback on StackOverflow only adds to the mystery. Pissing me off.. does this line above even work for anybody?
