From 7e68a7e8c6d06d7f8f849b0c996b015fbe6be469 Mon Sep 17 00:00:00 2001 From: David Saez Date: Tue, 24 Nov 2020 08:05:59 +0100 Subject: [PATCH] Fix whois not being defined and modernize some code --- example.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/example.php b/example.php index ba7f07e..952c96f 100644 --- a/example.php +++ b/example.php @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. header('Content-Type: text/html; charset=UTF-8'); -$out = implode('', file('example.html')); +$out = file_get_contents('example.html'); $out = str_replace('{self}', $_SERVER['PHP_SELF'], $out); @@ -37,10 +37,7 @@ if (isSet($_GET['query'])) { $query = $_GET['query']; - if (!empty($_GET['output'])) - $output = $_GET['output']; - else - $output = ''; + $output = empty($_GET['output']) ? '' : $_GET['output']; include_once('src/whois.main.php'); include_once('src/whois.utils.php'); @@ -109,11 +106,14 @@ if (isSet($_GET['query'])) } $resout = str_replace('{result}', $winfo, $resout); + $out = str_replace('{ver}', $whois->CODE_VERSION, $out); } else + { $resout = ''; + $out = str_replace('{ver}', '', $out); + } -$out = str_replace('{ver}',$whois->CODE_VERSION,$out); exit(str_replace('{results}', $resout, $out)); //-------------------------------------------------------------------------