Skip to content

Commit cbc1682

Browse files
committed
Fix broken port concatination
strpo === 0 means it would only run if the : was at the beginning of the line. Should use !== FALSE or the new str_contains function. $service_types_ports wasn't set as a global, so it was empty inside the function (noticed after fixing above).
1 parent 7e1faf1 commit cbc1682

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

includes/arrays.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
include_once(__DIR__ . '/constants.php');
2626

27-
global $servcheck_actions_proxy, $servcheck_actions_test, $servcheck_actions_ca,$servcheck_actions_restapi,
28-
$graph_interval,
27+
global $servcheck_actions_proxy, $servcheck_actions_test, $servcheck_actions_ca, $servcheck_actions_restapi,
28+
$graph_interval, $service_types_ports,
2929
$servcheck_proxy_fields, $servcheck_test_fields, $servcheck_ca_fields,
3030
$servcheck_notify_accounts, $httperrors, $servcheck_seconds,
3131
$search, $mail_serv, $service_types, $curl_error, $search_result, $servcheck_tabs,

includes/tests.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function curl_try ($test) {
5757

5858
list($category,$service) = explode('_', $test['type']);
5959

60-
if (strpos($test['hostname'], ':') === 0) {
60+
if (!str_contains($test['hostname'], ':')) {
6161
$test['hostname'] .= ':' . $service_types_ports[$test['type']];
6262
}
6363

0 commit comments

Comments
 (0)