Ultimate SEO Urls

htmlspecialchars_decode(): Passing null - Ultimate SEO Urls

htmlspecialchars_decode(): Passing null

by BatteryTrader » Wed Jul 16, 2025 6:44 am

Ultimate seo URLs 3.08 with php8.3 on 1.1.0.3

I get the php error

Code: Select all

Got error 'PHP message: PHP Deprecated:  htmlspecialchars_decode(): Passing null to parameter #1 ($string) of type string is deprecated in /home/SERVER/domains/DOMAIN.com/public_html/includes/apps/ultimate_seo_urls/main/validator.php on line 120'
After tracking down the cause it appears to be a request for a page not on the site, and returns a 404 as should.

The line at includes/apps/ultimate_seo_urls/main/validator.php on line is

Code: Select all

$new_url = htmlspecialchars_decode( usu_Main::i()->hrefLink( usu_Main::i()->getVar( 'filename' ), url_query::parse ( usu_Main::i()->getVar( 'request_querystring' ) ) ) );
Now My thinking is that if the page does not exist its dragging NULL and PHP does not like it

I thought it was the filename in the Variable and tried things like “ hrefLink( usu_Main::i()->getVar( 'filename' ) ?? ‘’, “ but not worked.

The issue does not break the site, but would like to fix it, any pointers?

Kindest regards

David
BatteryTrader
Contributor
Posts: 153
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Contact:

Re: htmlspecialchars_decode(): Passing null

by BrockleyJohn » Mon Jul 21, 2025 5:53 pm

Try adding it before the last bracket:

Code: Select all

//
$new_url = htmlspecialchars_decode( usu_Main::i()->hrefLink( usu_Main::i()->getVar( 'filename' ), url_query::parse ( usu_Main::i()->getVar( 'request_querystring' ) ) ) ?? '');
//
BrockleyJohn
Certified Developer
Posts: 173
Joined: Mon Mar 01, 2021 5:37 pm
Phoenix Version:
Contact: