Merge branch 'master' of github.com:sparc/phpWhois.org

mtf
This commit is contained in:
David Saez 2022-02-22 08:18:18 +01:00
commit a4e12e5cfa
3 changed files with 7 additions and 7 deletions

View file

@ -183,7 +183,7 @@ or not and which is the registrar but not the owner information.
### UTF-8 ### UTF-8
PHPWhois will assume that all whois servers resturn UTF-8 encoded output, PHPWhois will assume that all whois servers return UTF-8 encoded output,
if some whois server does not return UTF-8 data, you can include it in if some whois server does not return UTF-8 data, you can include it in
the `NON_UTF8` array in whois.servers.php the `NON_UTF8` array in whois.servers.php

View file

@ -194,7 +194,7 @@ class WhoisClient {
while (!feof($ptr)) while (!feof($ptr))
{ {
if (stream_select($r,$null,$null,$this->STIMEOUT)) if (@stream_select($r,$null,$null,$this->STIMEOUT)!==false)
{ {
$raw .= fgets($ptr, $this->BUFFER); $raw .= fgets($ptr, $this->BUFFER);
} }

View file

@ -374,7 +374,7 @@ class idna_convert
$delim_pos = strrpos($encoded, '-'); $delim_pos = strrpos($encoded, '-');
if ($delim_pos > strlen($this->_punycode_prefix)) { if ($delim_pos > strlen($this->_punycode_prefix)) {
for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) { for ($k = strlen($this->_punycode_prefix); $k < $delim_pos; ++$k) {
$decoded[] = ord($encoded{$k}); $decoded[] = ord($encoded[$k]);
} }
} else { } else {
$decoded = array(); $decoded = array();
@ -390,7 +390,7 @@ class idna_convert
for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) { for ($enco_idx = ($delim_pos) ? ($delim_pos + 1) : 0; $enco_idx < $enco_len; ++$deco_len) {
for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) { for ($old_idx = $idx, $w = 1, $k = $this->_base; 1 ; $k += $this->_base) {
$digit = $this->_decode_digit($encoded{$enco_idx++}); $digit = $this->_decode_digit($encoded[$enco_idx++]);
$idx += $digit * $w; $idx += $digit * $w;
$t = ($k <= $bias) ? $this->_tmin : $t = ($k <= $bias) ? $this->_tmin :
(($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias)); (($k >= $bias + $this->_tmax) ? $this->_tmax : ($k - $bias));
@ -793,7 +793,7 @@ class idna_convert
$mode = 'next'; $mode = 'next';
$test = 'none'; $test = 'none';
for ($k = 0; $k < $inp_len; ++$k) { for ($k = 0; $k < $inp_len; ++$k) {
$v = ord($input{$k}); // Extract byte from input string $v = ord($input[$k]); // Extract byte from input string
if ($v < 128) { // We found an ASCII char - put into stirng as is if ($v < 128) { // We found an ASCII char - put into stirng as is
$output[$out_len] = $v; $output[$out_len] = $v;
@ -932,7 +932,7 @@ class idna_convert
$out_len++; $out_len++;
$output[$out_len] = 0; $output[$out_len] = 0;
} }
$output[$out_len] += ord($input{$i}) << (8 * (3 - ($i % 4) ) ); $output[$out_len] += ord($input[$i]) << (8 * (3 - ($i % 4) ) );
} }
return $output; return $output;
} }
@ -966,4 +966,4 @@ class Net_IDNA_php4 extends idna_convert
} }
} }
?> ?>