Skip to content

Commit 10dc05e

Browse files
Copilot0x5t4l1n
andauthored
Adjust both pages to avoid over-restrictive client IP regex validation
Agent-Logs-Url: https://github.com/th30d4y/IP/sessions/6013f9b8-efa5-4d7e-a703-44d539e8bb47 Co-authored-by: Stalin-143 <161853795+Stalin-143@users.noreply.github.com>
1 parent f6da059 commit 10dc05e

2 files changed

Lines changed: 0 additions & 24 deletions

File tree

both.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ <h1>IP Reputation Checker - Both Services</h1>
4242
<div class="result" id="result"></div>
4343

4444
<script>
45-
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
46-
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4})$/;
47-
48-
function isValidIP(ip) {
49-
return ipv4Regex.test(ip) || ipv6Regex.test(ip);
50-
}
51-
5245
function addLabeledValue(container, label, value) {
5346
const p = document.createElement("p");
5447
const strong = document.createElement("b");
@@ -67,11 +60,6 @@ <h1>IP Reputation Checker - Both Services</h1>
6760
return;
6861
}
6962

70-
if (!isValidIP(ip)) {
71-
resultDiv.textContent = "Invalid IP address format. Please enter a valid IPv4 or IPv6 address.";
72-
return;
73-
}
74-
7563
if (ip.length > 45) {
7664
resultDiv.textContent = "IP address is too long.";
7765
return;

public/both.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ <h1>IP Reputation Checker - Both Services</h1>
4242
<div class="result" id="result"></div>
4343

4444
<script>
45-
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
46-
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4})$/;
47-
48-
function isValidIP(ip) {
49-
return ipv4Regex.test(ip) || ipv6Regex.test(ip);
50-
}
51-
5245
function addLabeledValue(container, label, value) {
5346
const p = document.createElement("p");
5447
const strong = document.createElement("b");
@@ -67,11 +60,6 @@ <h1>IP Reputation Checker - Both Services</h1>
6760
return;
6861
}
6962

70-
if (!isValidIP(ip)) {
71-
resultDiv.textContent = "Invalid IP address format. Please enter a valid IPv4 or IPv6 address.";
72-
return;
73-
}
74-
7563
if (ip.length > 45) {
7664
resultDiv.textContent = "IP address is too long.";
7765
return;

0 commit comments

Comments
 (0)