Fixed inet_pton(): Unrecognized address unknown

PaulB

Well-known member
Hmm... i change php 7.2 to php 8.
UPD.
  • ErrorException: [E_WARNING] Trying to access array offset on value of type bool
  • src/XF/Util/Ip.php:340
Can you provide a full stack trace? That looks like a different error, but you haven't given enough context for us to determine where the error is occurring.

for example xenforo gives information about a version when it is released. mysql: 5.5 also use PHP:8. Following those recommendations is to get the most out of the forum
Although there isn't an explicit recommendation, you'll need to use MySQL 5.6 or later if you want Unicode emoji to work correctly, and you'll need 8.0 or later for ideal Unicode support. 8.0 brought an overhaul to MySQL's Unicode implementation.
 
Last edited:

bebekforum

Well-known member
Tam bir yığın izi sağlayabilir misiniz? Bu farklı bir hata gibi görünüyor, ancak hatanın nerede oluştuğunu belirlememiz için yeterli bağlam sağlamadınız.


Açık bir öneri olmamasına rağmen, Unicode emojinin düzgün çalışmasını istiyorsanız MySQL 5.6 veya sonraki bir sürümünü kullanmanız ve ideal Unicode desteği için 8.0 veya sonraki bir sürümüne ihtiyacınız olacak. 8.0, MySQL'in Unicode uygulamasına bir revizyon getirdi.
I wrote it like that. i am using mariadb 5.5. I'll pass it to 10 a or fix whichever is higher


F611818E-3F9B-4280-A3B2-6A090908B06A.png
 

Surf_Rider

Active member
Error
  • ErrorException: [E_WARNING] Trying to access array offset on value of type bool
  • src/XF/Util/Ip.php:340
Trace stack
#0 src/XF/Util/Ip.php(340): XF::handlePhpError(2, '[E_WARNING] Try...', '/home/sad2236...', 340)
#1 src/XF/Http/Reader.php(365): XF\Util\Ip::ipMatchesCidrRange(false, false, 3)
#2 src/XF/Http/Reader.php(296): XF\Http\Reader->isLocalIpv6(false)
#3 src/XF/Http/Reader.php(106): XF\Http\Reader->isRequestableUntrustedUrlExtended('https://docs.mi...', NULL, NULL)
#4 src/XF/Http/Reader.php(81): XF\Http\Reader->requestUntrusted('get', 'https://docs.mi...', Array, NULL, Array, NULL)
#5 src/XF/Http/MetadataFetcher.php(56): XF\Http\Reader->getUntrusted('https://docs.mi...', Array, NULL, Array, NULL)
#6 src/XF/Service/Unfurl/Fetcher.php(22): XF\Http\MetadataFetcher->fetch('https://docs.mi...', NULL)
#7 unfurl.php(71): XF\Service\Unfurl\Fetcher->fetch()
#8 {main}
array(4) {
["url"] => string(11) "/unfurl.php"
["referrer"] => string(39) "https://site/threads/17439/"
["_GET"] => array(0) {
}
["_POST"] => array(4) {
["result_ids"] => array(1) {
[0] => string(3) "584"
}
["_xfRequestUri"] => string(15) "/threads/17439/"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}


WebServer configuration

Версия PHP 8.0.1
Версия MySQL 5.6.41 (5.6.41-84.1)
Программное обеспечение сервера Apache/2.4.41 (Ubuntu) PHP/8.0.1
PHP memory_limit 128M
PHP post_max_size 64M
PHP upload_max_filesize 64M
PHP max_input_vars 10000
PHP max_execution_time 60
Версия cURL 7.47.0
Версия SSL для cURL OpenSSL/1.0.2g
Версия OpenSSL OpenSSL 1.0.2g 1 Mar 2016
Suhosin включён Нет
Поддержка Imagick Нет
Поддержка EXIF Нет
Поддержка GZip Да
Поддержка mbstring Да
Поддержка gmp Нет
Поддержка ZipArchive Да
 

PaulB

Well-known member
@Surf_Rider, if you look in your stack trace, there's a URL beginning with docs.mi. Could you send me the full hostname? I don't need the full URL, just the hostname.

Also, if you know how to run commands on your server, could you send me the output from the following? Replace HOSTNAME.HERE with the full hostname beginning with docs.mi.
Bash:
php -r 'var_export(array_map(fn($h) => @dns_get_record($h, DNS_AAAA), ["HOSTNAME.HERE", "google.com"])); echo PHP_EOL;'

@Jeremy P, there's at least one XF bug in this thread that can be easily fixed. tl;dr inet_pton triggers a warning on PHP < 7.3 when passed an invalid IP address, so it needs a suppression operator. PHP >= 7.3 returns false without triggering a warning.
 

Surf_Rider

Active member
@Surf_Rider, if you look in your stack trace, there's a URL beginning with docs.mi. Could you send me the full hostname? I don't need the full URL, just the hostname.

Also, if you know how to run commands on your server, could you send me the output from the following? Replace HOSTNAME.HERE with the full hostname beginning with docs.mi.
Bash:
php -r 'var_export(array_map(fn($h) => @dns_get_record($h, DNS_AAAA), ["HOSTNAME.HERE", "google.com"])); echo PHP_EOL;'

@Jeremy P, there's at least one XF bug in this thread that can be easily fixed. tl;dr inet_pton triggers a warning on PHP < 7.3 when passed an invalid IP address, so it needs a suppression operator. PHP >= 7.3 returns false without triggering a warning.
Thanks for reply. I have already restored forum from backups:(. I will write latter about error. And thanks again.
UPD
url is
https://docs.microsoft.com/ru-ru/Exchange/plan-and-deploy/prerequisites?view=exchserver-2016
When i paste this URL in thread and post it i have this error in admincp
  • ErrorException: [E_WARNING] inet_pton(): Unrecognized address 2a02:26f0:9500:489::353e
  • src/XF/Http/Reader.php:364
trace
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] ine...', '/home/sys6...', 364, Array)
#1 src/XF/Http/Reader.php(364): inet_pton('2a02:26f0:9500:...')
#2 src/XF/Http/Reader.php(296): XF\Http\Reader->isLocalIpv6('2a02:26f0:9500:...')
#3 src/XF/Http/Reader.php(106): XF\Http\Reader->isRequestableUntrustedUrlExtended('https://docs.mi...', NULL, NULL)
#4 src/XF/Http/Reader.php(81): XF\Http\Reader->requestUntrusted('get', 'https://docs.mi...', Array, NULL, Array, NULL)
#5 src/XF/Http/MetadataFetcher.php(60): XF\Http\Reader->getUntrusted('https://docs.mi...', Array, NULL, Array, NULL)
#6 src/XF/Service/Unfurl/Fetcher.php(22): XF\Http\MetadataFetcher->fetch('https://docs.mi...', NULL)
#7 unfurl.php(71): XF\Service\Unfurl\Fetcher->fetch()
#8 {main}

array(4) {
["url"] => string(11) "/unfurl.php"
["referrer"] => string(39) "https://sysadmins.online/threads/19320/"
["_GET"] => array(0) {
}
["_POST"] => array(4) {
["result_ids"] => array(1) {
[0] => string(3) "708"
}
["_xfRequestUri"] => string(15) "/threads/19320/"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}
 
Last edited:

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.11).

Change log:
Suppress warnings when converting invalid IP addresses on older versions of PHP
There may be a delay before changes are rolled out to the XenForo Community.
 
Top