mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 20:55:28 +00:00
Merge pull request #1372 from pi-hole/indexOf
Always use `!== -1` to check for a string's existence
This commit is contained in:
@@ -470,7 +470,7 @@ function updateForwardDestinationsPie() {
|
||||
|
||||
// Collect values and colors
|
||||
$.each(data.forward_destinations, function (key, value) {
|
||||
if (key.indexOf("|") > -1) {
|
||||
if (key.indexOf("|") !== -1) {
|
||||
key = key.substr(0, key.indexOf("|"));
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ function updateTopClientsChart() {
|
||||
}
|
||||
|
||||
client = escapeHtml(client);
|
||||
if (client.indexOf("|") > -1) {
|
||||
if (client.indexOf("|") !== -1) {
|
||||
idx = client.indexOf("|");
|
||||
clientname = client.substr(0, idx);
|
||||
clientip = client.substr(idx + 1, client.length - idx);
|
||||
@@ -605,7 +605,7 @@ function updateTopClientsChart() {
|
||||
}
|
||||
|
||||
client = escapeHtml(client);
|
||||
if (client.indexOf("|") > -1) {
|
||||
if (client.indexOf("|") !== -1) {
|
||||
idx = client.indexOf("|");
|
||||
clientname = client.substr(0, idx);
|
||||
clientip = client.substr(idx + 1, client.length - idx);
|
||||
|
||||
Reference in New Issue
Block a user