mirror of
https://github.com/Jackett/Jackett.git
synced 2025-10-02 08:34:32 +02:00
Very basic range check for port number
This commit is contained in:
@@ -392,6 +392,13 @@ namespace Jackett.Controllers
|
|||||||
return Json(jsonReply);
|
return Json(jsonReply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (port < 1 || port > 65535)
|
||||||
|
{
|
||||||
|
jsonReply["result"] = "error";
|
||||||
|
jsonReply["error"] = "The port you have selected is invalid, it must be below 65535.";
|
||||||
|
return Json(jsonReply);
|
||||||
|
}
|
||||||
|
|
||||||
// Save port to the config so it can be picked up by the if needed when running as admin below.
|
// Save port to the config so it can be picked up by the if needed when running as admin below.
|
||||||
Engine.Server.Config.AllowExternal = external;
|
Engine.Server.Config.AllowExternal = external;
|
||||||
Engine.Server.Config.Port = port;
|
Engine.Server.Config.Port = port;
|
||||||
|
Reference in New Issue
Block a user