SQL bug fixed, now working correctly!
This commit is contained in:
parent
ea352a640a
commit
e075c52488
3 changed files with 4 additions and 4 deletions
|
|
@ -104,7 +104,7 @@ if (!$ipAddr = inet_pton($ip)) {
|
||||||
if (isset($_GET["port"])) {
|
if (isset($_GET["port"])) {
|
||||||
$port = intval(urldecode($_GET["port"]));
|
$port = intval(urldecode($_GET["port"]));
|
||||||
} else {
|
} else {
|
||||||
bad_request("No port");
|
bad_request("No port");
|
||||||
}
|
}
|
||||||
|
|
||||||
$externalIp = get_external_ip();
|
$externalIp = get_external_ip();
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ function get_external_ip()
|
||||||
$result = curl_exec($ch);
|
$result = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
if (result == false) {
|
if ($result == false) {
|
||||||
throw new Exception("request to ident.me failed");
|
throw new Exception("request to ident.me failed");
|
||||||
} else if (inet_pton($result) == false) {
|
} else if (inet_pton($result) == false) {
|
||||||
throw new Exception("ident.me respond invalid ip");
|
throw new Exception("ident.me respond invalid ip");
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Host: localhost
|
-- Host: localhost
|
||||||
-- Generation Time: Mar 16, 2022 at 01:15 PM
|
-- Generation Time: Mar 16, 2022 at 03:35 PM
|
||||||
-- Server version: 10.7.3-MariaDB
|
-- Server version: 10.7.3-MariaDB
|
||||||
-- PHP Version: 7.4.28
|
-- PHP Version: 7.4.28
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ SET time_zone = "+00:00";
|
||||||
CREATE TABLE `tracker` (
|
CREATE TABLE `tracker` (
|
||||||
`info_hash` char(40) COLLATE utf8mb4_unicode_ci NOT NULL,
|
`info_hash` char(40) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
`ip` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
|
`ip` varchar(40) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
`port` smallint(5) NOT NULL,
|
`port` smallint(5) UNSIGNED NOT NULL,
|
||||||
`update_time` timestamp NOT NULL DEFAULT current_timestamp()
|
`update_time` timestamp NOT NULL DEFAULT current_timestamp()
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue