<?php require_once $settings['functions'] . 'function.tracker.allowed.php'; $result = tracker_allowed($connection, $settings); if (!empty($result)) { echo 'Error: Empty query was not empty.' . PHP_EOL; $failure = true; } $insert = 'INSERT INTO `' . $settings['db_prefix'] . 'torrents` ( `info_hash` ) VALUES (\'__TEST_1__\'), (\'__TEST_2__\'), (\'__TEST_3__\');'; mysqli_query($connection, $insert); $result = tracker_allowed($connection, $settings); $count = count($result); if ($count != 3) { echo 'Error: Query for 3 items returned ' . $count . PHP_EOL; $failure = true; } $delete = 'DELETE FROM `' . $settings['db_prefix'] . 'torrents` WHERE `info_hash` LIKE \'__TEST_%\';'; mysqli_query($connection, $delete);
// If the root isn't a directory up, modify that here. $settings['root'] = __DIR__ . '/'; // Don't modify these, they'll figure it out. $settings['functions'] = $settings['root'] . '_functions/phoenix/'; $settings['hooks'] = $settings['root'] . '_hooks/phoenix/'; $settings['onces'] = $settings['root'] . '_onces/phoenix/'; $settings['settings'] = $settings['root'] . '_settings/'; //// Error Level // error_reporting(E_ALL); // error_reporting(E_ALL & ~E_WARNING); // error_reporting(E_ALL | E_STRICT | E_DEPRECATED); error_reporting(0); // Ignore Disconnects ignore_user_abort(true); ini_set('default_charset', 'iso-8859-1'); $time = time(); $chance = mt_rand(1, 100); // Allow Access from Anywhere header('Access-Control-Allow-Origin: *'); // Override the default database variables with this. include $settings['settings'] . 'phoenix.default.php'; if (is_readable($settings['settings'] . 'phoenix.custom.php')) { include $settings['settings'] . 'phoenix.custom.php'; } require_once $settings['functions'] . 'function.tracker.error.php'; // DB_Connect must be loaded after tracker_error and settings. require_once $settings['onces'] . 'once.db.connect.php'; if (!$settings['open_tracker']) { require_once $settings['functions'] . 'function.tracker.allowed.php'; $allowed_torrents = tracker_allowed($connection, $settings); }
// Strip auto-escaped data. if (isset($_GET['info_hash'])) { $_GET['info_hash'] = stripslashes($_GET['info_hash']); } if (isset($_GET['peer_id'])) { $_GET['peer_id'] = stripslashes($_GET['peer_id']); } } // END IF MAGIC QUOTES // IF BINARY if (isset($_GET['info_hash']) && strlen($_GET['info_hash']) == 20) { $_GET['info_hash'] = bin2hex($_GET['info_hash']); } if (isset($_GET['peer_id']) && strlen($_GET['peer_id']) == 20) { $_GET['peer_id'] = bin2hex($_GET['peer_id']); } // END IF BINARY // Allow Access from Anywhere header('Access-Control-Allow-Origin: *'); // Override the default database variables with this. include __DIR__ . '/settings.default.php'; if (is_readable(__DIR__ . '/settings.custom.php')) { include __DIR__ . '/settings.custom.php'; } // require_once __DIR__.'/once.db.connect.php'; require_once __DIR__ . '/function.tracker.error.php'; // require_once __DIR__.'/function.tracker.stats.php'; if (!$settings['open_tracker']) { require_once __DIR__ . '/function.tracker.allowed.php'; $torrents = tracker_allowed(); }