Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Notice/Error on PHP8.1

$
0
0

Replies: 0

On php 8, sending null in functions that expect strings will give a notice.

On Tools.php, method getOptions, you have
$homepath = ltrim(parse_url(site_url(), PHP_URL_PATH), '/');

In case the path is empty, parse_url returns null, then ltrim gives a notice because you’re not sending a string.

You should replace it with
$homepath = ltrim(parse_url(site_url(), PHP_URL_PATH)??'', '/');

See this :

https://3v4l.org/QRC1o


Viewing all articles
Browse latest Browse all 59525

Trending Articles