Просмотр исходного кода

Fix in show ip bgp neighbors command (issue #14)

Dmitry Shin лет назад: 8
Родитель
Сommit
93bbbac5fe
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      htdocs/index.php

+ 3 - 3
htdocs/index.php

@@ -1,6 +1,6 @@
 <?php
 <?php
 /**
 /**
- * HSDN PHP Looking Glass version 1.2.14b
+ * HSDN PHP Looking Glass version 1.2.15b
  *
  *
  * General Features:
  * General Features:
  *  - Supports the Telnet and SSH (through Putty/plink)
  *  - Supports the Telnet and SSH (through Putty/plink)
@@ -1503,7 +1503,7 @@ function parse_out($output, $check = FALSE)
 	if (preg_match("/^show ip bgp n\w*\s+([\d\.]+)/i", $exec) OR
 	if (preg_match("/^show ip bgp n\w*\s+([\d\.]+)/i", $exec) OR
 			 preg_match("/^show ip bgp n\w*$/i", $exec))
 			 preg_match("/^show ip bgp n\w*$/i", $exec))
 	{
 	{
-		if (!isset($lastip) AND preg_match("/^BGP neighbor is ([\d\.]+),/", $output, $lastip_exp))
+		if (!isset($lastip) AND preg_match("/^BGP neighbor is ([\d\.]+)(,?)/", $output, $lastip_exp))
 		{
 		{
 			$lastip = $lastip_exp[1];
 			$lastip = $lastip_exp[1];
 		}
 		}
@@ -1567,7 +1567,7 @@ function parse_out($output, $check = FALSE)
 			$output
 			$output
 		);
 		);
 		$output = preg_replace_callback(
 		$output = preg_replace_callback(
-			"/^(BGP neighbor is )(\d+\.\d+\.\d+\.\d+)(,)/",
+			"/^(BGP neighbor is )(\d+\.\d+\.\d+\.\d+)(,?)/",
 			function ($matches) {
 			function ($matches) {
 				return $matches[1].link_whois($matches[2]).$matches[3];
 				return $matches[1].link_whois($matches[2]).$matches[3];
 			},
 			},