From 84fcedc203fdf7face427a751820ad204344ba1a Mon Sep 17 00:00:00 2001 From: billz Date: Wed, 7 Jul 2021 23:24:49 +0100 Subject: [PATCH] Added get_public_ip() --- includes/functions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index b30ff825..8ccd2430 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -778,3 +778,13 @@ class validation } } +/* Resolves public IP address + * + * @return string $public_ip + */ +function get_public_ip() +{ + exec('wget https://ipinfo.io/ip -qO -', $public_ip); + return $public_ip[0]; +} +