Skip to content

Commit

Permalink
Merge pull request #719 from tarasfrompir/patch-41
Browse files Browse the repository at this point in the history
Update terminals.class.php
  • Loading branch information
sergejey committed Apr 7, 2020
2 parents 54546a4 + d0af135 commit baa2e31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/terminals.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ function getLocalIp() {
global $local_ip_address_cached;
if (isset($local_ip_address_cached)) {
$local_ip_address=$local_ip_address_cached;
} else if ($_SERVER['SERVER_ADDR'] != '127.0.0.1') {
$local_ip_address = $_SERVER['SERVER_ADDR'];
} else {
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_connect($s, '8.8.8.8', 53); // connecting to a UDP address doesn't send packets
Expand Down

0 comments on commit baa2e31

Please sign in to comment.