浏览代码

[Web] Fix transport validation

andryyy 4 年之前
父节点
当前提交
913e9cbb11
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      data/web/inc/functions.transports.inc.php

+ 2 - 2
data/web/inc/functions.transports.inc.php

@@ -262,7 +262,7 @@ function transport($_action, $_data = null) {
       $destinations = array_filter(array_values(array_unique($destinations)));
       $destinations = array_filter(array_values(array_unique($destinations)));
       if (empty($destinations)) { return false; }
       if (empty($destinations)) { return false; }
       if (isset($next_hop_matches[1])) {
       if (isset($next_hop_matches[1])) {
-        if (in_array($next_hop_clean, $existing_nh)) {
+        if ($existing_nh !== null && in_array($next_hop_clean, $existing_nh)) {
           $_SESSION['return'][] = array(
           $_SESSION['return'][] = array(
             'type' => 'danger',
             'type' => 'danger',
             'log' => array(__FUNCTION__, $_action, $_data_log),
             'log' => array(__FUNCTION__, $_action, $_data_log),
@@ -379,7 +379,7 @@ function transport($_action, $_data = null) {
           return false;
           return false;
         }
         }
         if (isset($next_hop_matches[1])) {
         if (isset($next_hop_matches[1])) {
-          if (in_array($next_hop_clean, $existing_nh)) {
+          if ($existing_nh !== null && in_array($next_hop_clean, $existing_nh)) {
             $_SESSION['return'][] = array(
             $_SESSION['return'][] = array(
               'type' => 'danger',
               'type' => 'danger',
               'log' => array(__FUNCTION__, $_action, $_data_log),
               'log' => array(__FUNCTION__, $_action, $_data_log),