This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

PHP v8.x warning
#1

Hello,

Running Commentics using PHP 8.3 , overall seems to work fine, just 1 warning keeps popping up in the logs:

PHP Deprecated:  str_ireplace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /commentics/system/library/page.php on line 46

This should affect all users with PHP 8.1, 8.2, 8.3 or newer

Please advise
Reply
#2

Interesting, I don't seem to get that error on my local installation which is also on PHP 8.3.

To avoid the error happening, you could replace the line it mentioned:
PHP Code:
<?php 
$domain
= str_ireplace('www.', '', parse_url($this->url->decode($this->page_url), PHP_URL_HOST));

With this:
PHP Code:
<?php 
$domain
= parse_url($this->url->decode($this->page_url), PHP_URL_HOST);

if (
$domain) {
    $domain = str_ireplace('www.', '', $domain);
}

However the error is really a symptom of another issue which is that it can't extract the domain from your page's URL.

So if possible could you add this above the code that you replaced:
PHP Code:
<?php 
var_dump
($this->page_url);

That should display on your screen what it thinks your page's URL is. If it doesn't display, it's likely happening during an ajax request. If you could also tell me what you're doing on Commentics when the error happens. For example is it when you submit the form or select a country etc.

Have you completed the interview?
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post

Forum Jump:


Users browsing this thread: 1 Guest(s)