[DigitalPoint] App for Cloudflare®

[DigitalPoint] App for Cloudflare® 1.9.8

No permission to download
Hi! In the latest version, I get this error when viewing a user IP list from the admin panel:

Code:
Server error log
ValueError: Template admin:user_ip_list error: inet_pton(): Argument #1 ($ip) must not contain any null bytes src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:31
Generated by: Rhodium Dec 17, 2025 at 4:57 PM
Stack trace
#0 src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php(31): inet_pton([invalid])
#1 src/XF/Template/Templater.php(1186): DigitalPoint\Cloudflare\XF\Template\Templater->filterGeo(Object(SV\StandardLib\XF\Template\Templater), [invalid], false)
#2 internal_data/code_cache/templates/l1/s0/admin/user_ip_list.php(28): XF\Template\Templater->filter([invalid], Array, false)
#3 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#4 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('user_ip_list', Array)
#5 src/XF/Mvc/Renderer/Json.php(86): XF\Template\Template->render()
#6 src/XF/Mvc/Renderer/Json.php(70): XF\Mvc\Renderer\Json->renderHtmlFallback('XF:User\\IpList', 'admin:user_ip_l...', Array)
#7 src/XF/Mvc/Dispatcher.php(471): XF\Mvc\Renderer\Json->renderView('XF:User\\IpList', 'admin:user_ip_l...', Array)
#8 src/XF/Mvc/Dispatcher.php(453): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(412): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#10 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#11 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#12 src/XF.php(806): XF\App->run()
#13 admin.php(15): XF::runApp('XF\\Admin\\App')
#14 {main}
Request state
array(4) {
  ["url"] => string(197) "/admin.php?users/troy-mcclon.301320/user-ips&_xfResponseType=json&_xfWithData=1&_xfRequestUri=%2Fadmin.php%3Fusers%2Ftroy-mcclon.301320%2Fedit&_xfToken=****"
  ["referrer"] => string(58) "https://****.com/admin.php?users/troy-mcclon.301320/edit"
  ["_GET"] => array(5) {
    ["users/troy-mcclon_301320/user-ips"] => string(0) ""
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["_xfRequestUri"] => string(40) "/admin.php?users/troy-mcclon.301320/edit"
    ["_xfToken"] => string(43) "****"
  }
  ["_POST"] => array(0) {
  }
}
What version of PHP are you using? No matter how I try, I've not been able to even get that error at the most basic level with inet_pton. Tried with PHP 7, PHP 8, tried forcing null characters into the function, etc.

Side note, it's also the exact same way XenForo core is using inet_pton in 2.3...
 
What version of PHP are you using? No matter how I try, I've not been able to even get that error at the most basic level with inet_pton. Tried with PHP 7, PHP 8, tried forcing null characters into the function, etc.

Side note, it's also the exact same way XenForo core is using inet_pton in 2.3...
I just updated to php 8.3.29 earlier today (from 8.3.28) and started seeing similar IP related errors.

Perhaps related to a security fix:

 
Last edited:
What version of PHP are you using? No matter how I try, I've not been able to even get that error at the most basic level with inet_pton. Tried with PHP 7, PHP 8, tried forcing null characters into the function, etc.

Side note, it's also the exact same way XenForo core is using inet_pton in 2.3...

I’m on PHP 8.3.29. I tested a backup in a different environment with no errors, so I think its what @azzurro pointed.
 
I got the same error now after I updated to PHP 8.4.16; there was no issue with 8.4.15.

PHP:
ValueError: Template public:member_self_ip_list error: inet_pton(): Argument #1 ($ip) must not contain any null bytes src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:31
 
In the src\addons\DigitalPoint\Cloudflare\XF\Template.php file, if you change this:

PHP:
$binaryValue = @inet_pton($value);
if ($binaryValue === false)
{
    $binaryValue = $value;
}

PHP:
if (strpos($value, "\0") !== false)
{
    $binaryValue = $value;
}
else
{
    $binaryValue = @inet_pton($value);
    if ($binaryValue === false)
    {
        $binaryValue = $value;
    }
}

...does that sort it out for whatever versions of PHP it's an issue with?
 
In the src\addons\DigitalPoint\Cloudflare\XF\Template.php file, if you change this:

PHP:
$binaryValue = @inet_pton($value);
if ($binaryValue === false)
{
    $binaryValue = $value;
}

PHP:
if (strpos($value, "\0") !== false)
{
    $binaryValue = $value;
}
else
{
    $binaryValue = @inet_pton($value);
    if ($binaryValue === false)
    {
        $binaryValue = $value;
    }
}

...does that sort it out for whatever versions of PHP it's an issue with?

Yep, it's working fine with that, thanks!
 
I'm trying to use @AndyB's STL viewer add-on but I'm getting an error:

ErrorException: [E_WARNING] rewind(): Stream does not support seeking in src/addons/DigitalPoint/Cloudflare/Api/Advanced.php at line 794
  1. XF::handlePhpError()
  2. rewind() in src/addons/DigitalPoint/Cloudflare/Api/Advanced.php at line 794
  3. DigitalPoint\Cloudflare\Api\Advanced->signS3Request() in src/addons/DigitalPoint/Cloudflare/Api/Cloudflare.php at line 689
  4. DigitalPoint\Cloudflare\Api\CloudflareAbstract->makeRequest() in src/addons/DigitalPoint/Cloudflare/Api/Advanced.php at line 750
  5. DigitalPoint\Cloudflare\Api\Advanced->createR2Object() in src/addons/DigitalPoint/Cloudflare/League/Flysystem/Adapter/R2.php at line 103
  6. DigitalPoint\Cloudflare\League\Flysystem\Adapter\R2->writeStream() in src/vendor/league/flysystem/src/Filesystem.php at line 87
  7. League\Flysystem\Filesystem->writeStream() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 430
  8. League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 395
  9. League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall() in src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php at line 275
  10. League\Flysystem\EventableFilesystem\EventableFilesystem->writeStream() in src/vendor/league/flysystem/src/MountManager.php at line 462
  11. League\Flysystem\MountManager->writeStream() in src/addons/Andy/STLViewer/Pub/Controller/STLViewer.php at line 99
  12. Andy\STLViewer\Pub\Controller\STLViewer->actionIndex() in src/XF/Mvc/Dispatcher.php at line 362
  13. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
  14. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
  15. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
  16. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2824
  17. XF\App->run() in src/XF.php at line 806
  18. XF::runApp() in index.php at line 23
 
I'm trying to use @AndyB's STL viewer add-on but I'm getting an error:
Don't know anything about that addon, but if it's trying to save something to an R2 bucket (within data or internal_data, the source "file" stream would need to be seekable. My guess is it's trying to save a "file" with a URL as a source possibly?

If I knew what the source file type is, I could probably whip up something to work around it.
 
I'm trying to use @AndyB's STL viewer add-on but I'm getting an error:
If you edit the src\addons\DigitalPoint\Cloudflare\Api\Advanced.php file, and change this:
PHP:
if (!empty($params['body']) && is_resource($params['body']))

...to this:
PHP:
        if (!empty($params['body']) && is_resource($params['body']) && empty(stream_get_meta_data($params['body'])['seekable']))
        {
            $params['body'] = stream_get_contents($params['body']);
        }

        if (!empty($params['body']) && is_resource($params['body']))

...basically adding a check to make sure something is seekable, if it's not just go ahead and read the whole thing into memory and deal with it that way. Not as efficient as a stream, but at least it will work.
 
Back
Top Bottom