aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Cleberg <hello@cleberg.net>2023-05-24 20:20:50 -0500
committerChristian Cleberg <hello@cleberg.net>2023-05-24 20:20:50 -0500
commit864f1349e47f924bcde20c1cc83d838b5c5c7316 (patch)
tree75a19d367ccd69486f5dcaab88c068b730d2d73e
parent725aeaabc6cc665e1e1f22a72a8a869541870e8d (diff)
downloadifconfig.php-864f1349e47f924bcde20c1cc83d838b5c5c7316.tar.gz
ifconfig.php-864f1349e47f924bcde20c1cc83d838b5c5c7316.tar.bz2
ifconfig.php-864f1349e47f924bcde20c1cc83d838b5c5c7316.zip
formatting
-rw-r--r--ifconfig.php32
1 files changed, 16 insertions, 16 deletions
diff --git a/ifconfig.php b/ifconfig.php
index b477140..8ece6ba 100644
--- a/ifconfig.php
+++ b/ifconfig.php
@@ -7,22 +7,22 @@ $source_repository = 'https://git.sr.ht/~cmc/ifconfig.php';
// Create array of values
$user = array(
- 'ip' => $_SERVER['REMOTE_ADDR'],
- 'host' => (isset($_SERVER['REMOTE_ADDR']) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ""),
- 'port' => $_SERVER['REMOTE_PORT'],
- 'ua' => $_SERVER['HTTP_USER_AGENT'],
- 'lang' => $_SERVER['HTTP_ACCEPT_LANGUAGE'],
- 'mime' => $_SERVER['HTTP_ACCEPT'],
- 'encoding' => $_SERVER['HTTP_ACCEPT_ENCODING'],
- 'charset' => $_SERVER['HTTP_ACCEPT_CHARSET'],
+ 'ip' => $_SERVER['REMOTE_ADDR'],
+ 'host' => (isset($_SERVER['REMOTE_ADDR']) ? gethostbyaddr($_SERVER['REMOTE_ADDR']) : ""),
+ 'port' => $_SERVER['REMOTE_PORT'],
+ 'ua' => $_SERVER['HTTP_USER_AGENT'],
+ 'lang' => $_SERVER['HTTP_ACCEPT_LANGUAGE'],
+ 'mime' => $_SERVER['HTTP_ACCEPT'],
+ 'encoding' => $_SERVER['HTTP_ACCEPT_ENCODING'],
+ 'charset' => $_SERVER['HTTP_ACCEPT_CHARSET'],
'connection' => $_SERVER['HTTP_CONNECTION'],
- 'cache' => $_SERVER['HTTP_CACHE_CONTROL'],
- 'cookie' => $_SERVER['HTTP_COOKIE'],
- 'referer' => $_SERVER['HTTP_REFERER'],
- 'real_ip' => $_SERVER['HTTP_X_REAL_IP'],
- 'fwd_ip' => $_SERVER['HTTP_X_FORWARDED_FOR'],
- 'fwd_host' => (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']) : ""),
- 'dnt' => $_SERVER['HTTP_DNT']
+ 'cache' => $_SERVER['HTTP_CACHE_CONTROL'],
+ 'cookie' => $_SERVER['HTTP_COOKIE'],
+ 'referer' => $_SERVER['HTTP_REFERER'],
+ 'real_ip' => $_SERVER['HTTP_X_REAL_IP'],
+ 'fwd_ip' => $_SERVER['HTTP_X_FORWARDED_FOR'],
+ 'fwd_host' => (isset($_SERVER['HTTP_X_FORWARDED_FOR']) ? gethostbyaddr($_SERVER['HTTP_X_FORWARDED_FOR']) : ""),
+ 'dnt' => $_SERVER['HTTP_DNT']
);
// Check request (ex. ifconfig.php?q=ip)
@@ -30,7 +30,7 @@ $query=trim(preg_replace('/ +/', ' ', preg_replace('/[^A-Za-z0-9 ]/', ' ', urlde
// Return single value on request & die
if (isset($query) && array_key_exists($query, $user)) {
- empty($user[$query]) ? die() : die($user[$query]."\n");
+ empty($user[$query]) ? die() : die($user[$query]."\n");
}
// Return full output in one of supported formats (html, text, xml, json. default: html)
elseif (isset($query) && (($query=="text") || ($query=="all"))) {