sparc / phpWhois.org

Original phpWhois soruces
http://www.phpwhois.org
GNU General Public License v2.0
95 stars 43 forks source link

php8.1 and php8.2 issues #32

Open tubby1981 opened 11 months ago

tubby1981 commented 11 months ago

I got timeouts in PHP 8.2 when searching for certain IPv6 addresses and was able to solve this


######## php 8.1 ########

Automatic conversion of false to array is deprecated in src/whois.parser.php on line 93

if ($newblock && $hasdata) { $blocks = array(); // added this in the code $blocks[$gkey] = $block; $block = array(); $gkey = ''; }

######## php 8.2 ########

Deprecated: Creation of dynamic property idna_convert::$slast is deprecated in src/whois.idna.php on line 96

class idna_convert { /**


With the above code changes the script works again, but there are still deprecated messages.

tubby1981 commented 11 months ago

Warning: Undefined array key "main" insrc/whois.parser.php on line 37

changed line 37 `from: if (empty($blocks) || !is_array($blocks['main']))

to:

if (empty($blocks) || (isset($blocks['main']) && !is_array($blocks['main'])))`