Xenforo version: 2.2.13 with no plugins installed and this patch
PHP version: 8.0.28 but tested also with 8.1
All Amazon link like this:
Generate an "ErrorException: [E_WARNING] Trying to access array offset on value of type bool src/XF/Util/Ip.php:340"
With PHP 7.4 it works without errors but my hosting is disabling it.
PHP version: 8.0.28 but tested also with 8.1
All Amazon link like this:
Code:
https://www.amazon.com/UPSKY-Colorful-Interactive-Physical-Exercise/dp/B07FZVML3X/ref=sr_1_6?crid=2CHY8D2JXKWRA&keywords=cat+toys&qid=1686834794&sprefix=cat%2Caps%2C178&sr=8-6
Generate an "ErrorException: [E_WARNING] Trying to access array offset on value of type bool src/XF/Util/Ip.php:340"
Code:
#0 src/XF/Util/Ip.php(340): XF::handlePhpError(2, '[E_WARNING] Try...', '/web/htdocs/www...', 340)
#1 src/XF/Http/Reader.php(368): XF\Util\Ip::ipMatchesCidrRange(false, false, 3)
#2 src/XF/Http/Reader.php(299): XF\Http\Reader->isLocalIpv6(false)
#3 src/XF/Http/Reader.php(106): XF\Http\Reader->isRequestableUntrustedUrlExtended('https://www.ama...', Array, NULL)
#4 src/XF/Http/Reader.php(81): XF\Http\Reader->requestUntrusted('get', 'https://www.ama...', Array, NULL, Array, NULL)
#5 src/XF/Http/MetadataFetcher.php(56): XF\Http\Reader->getUntrusted('https://amzn.to...', Array, NULL, Array, NULL)
#6 src/XF/Service/Unfurl/Fetcher.php(22): XF\Http\MetadataFetcher->fetch('https://amzn.to...', NULL)
#7 unfurl.php(71): XF\Service\Unfurl\Fetcher->fetch()
#8 {main}
Code:
array(4) {
["url"] => string(11) "/unfurl.php"
["referrer"] => string(57) "https://www.mysite.com/threads/php-8-0-link-amazon.8504/"
["_GET"] => array(0) {
}
["_POST"] => array(4) {
["result_ids"] => array(2) {
[0] => string(3) "553"
[1] => string(3) "555"
}
["_xfRequestUri"] => string(34) "/threads/php-8-0-link-amazon.8504/"
["_xfWithData"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}
With PHP 7.4 it works without errors but my hosting is disabling it.