@@ -41,7 +41,7 @@ function getConfigItem($section, $key, $configs) {
41
41
}
42
42
$ sectionpos ++;
43
43
}
44
-
44
+
45
45
return substr ($ configs [$ sectionpos ], strlen ($ key ) + 1 );
46
46
}
47
47
@@ -87,24 +87,24 @@ function getConnectedGateways($logLines) {
87
87
}
88
88
89
89
function getLinkedGateways ($ logLines ) {
90
- //0000000000111111111122222222223333333333444444444455555555556666666666
90
+ //0000000000111111111122222222223333333333444444444455555555556666666666
91
91
//0123456789012345678901234567890123456789012345678901234567890123456789
92
92
//M: 2016-06-24 11:11:41.787 Currently linked repeaters/gateways:
93
93
//M: 2016-06-24 11:11:41.787 GATEWAY : 217.82.212.214:42000 2/60
94
94
//M: 2016-06-24 11:11:41.787 DM0GER : 217.251.59.165:42000 5/60
95
95
96
96
$ gateways = Array ();
97
- for ($ i = count ($ logLines ); $ i >0 ; $ i --) {
97
+ for ($ i = count ($ logLines )- 1 ; $ i >0 ; $ i --) {
98
98
$ logLine = $ logLines [$ i ];
99
-
99
+
100
100
if (strpos ($ logLine , "Starting YSFReflector " )) {
101
101
return $ gateways ;
102
102
}
103
103
if (strpos ($ logLine , "No repeaters/gateways linked " )) {
104
104
return $ gateways ;
105
105
}
106
106
if (strpos ($ logLine , "Currently linked repeaters/gateways " )) {
107
- for ($ j = $ i +1 ; $ j <= count ($ logLines ); $ j ++) {
107
+ for ($ j = $ i +1 ; $ j <= count ($ logLines )- 1 ; $ j ++) {
108
108
$ logLine = $ logLines [$ j ];
109
109
if (!startsWith (substr ($ logLine ,27 ), " " )) {
110
110
return $ gateways ;
@@ -117,7 +117,7 @@ function getLinkedGateways($logLines) {
117
117
if ($ key === NULL ) {
118
118
array_push ($ gateways , Array ('callsign ' =>$ callsign ,'timestamp ' =>$ timestamp ,'ipport ' =>$ ipport ));
119
119
}
120
- }
120
+ }
121
121
}
122
122
}
123
123
}
@@ -136,7 +136,7 @@ function getHeardList($logLines) {
136
136
}
137
137
$ callsign2 = substr ($ logLine , strpos ($ logLine ,"from " ) + 5 , strpos ($ logLine ,"to " ) - strpos ($ logLine ,"from " ) - 6 );
138
138
$ callsign = trim ($ callsign2 );
139
- $ target = substr ($ logLine , strpos ($ logLine , "to " ) + 3 , strpos ($ logLine ,"at " ) - strpos ($ logLine ,"to " ) +6 );
139
+ $ target = substr ($ logLine , strpos ($ logLine , "to " ) + 3 , strpos ($ logLine ,"at " ) - strpos ($ logLine ,"to " ) +6 );
140
140
$ gateway = substr ($ logLine , strrpos ($ logLine ,"at " ) + 3 );
141
141
// Callsign or ID should be less than 11 chars long, otherwise it could be errorneous
142
142
if ( strlen ($ callsign ) < 11 ) {
@@ -176,4 +176,4 @@ function getSize($filesize, $precision = 2) {
176
176
}
177
177
return round ($ filesize , $ precision ).' ' .$ units [$ idUnit ].'B ' ;
178
178
}
179
- ?>
179
+ ?>
0 commit comments