Deprecated: nl2br()

Open to all! Ask other shopowners for help.
Post Reply
BatteryTrader
Contributor
Posts: 156
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Deprecated: nl2br()

Post by BatteryTrader »

Morning
I Have 1.1.0.3 running on PHP8.3, have an issue with Deprecated: nl2br() error, which I cannot work out yet

I think this is pulling data for info pages, and its probably blank and that's why its giving the warning (although might be completely wrong)

Code: Select all

[Thu Jul 10 07:30:02.156255 2025] [proxy_fcgi:error] [pid 1028240:tid 1028351] [client 80.190.80.176:0] AH01071: Got error 'PHP message: PHP Warning:  Undefined array key 0 in /home/SERVER/domains/DOMAIN.com/public_html/includes/system/versioned/1.0.7.6/info_pages.php on line 57; PHP message: PHP Warning:  Trying to access array offset on null in /home/SERVER/domains/DOMAIN.com/public_html/includes/classes/keys.php on line 97; PHP message: PHP Warning:  Trying to access array offset on null in /home/SERVER/domains/DOMAIN.com/public_html/includes/classes/keys.php on line 98; PHP message: PHP Deprecated:  nl2br(): Passing null to parameter #1 ($string) of type string is deprecated in /home/batterycom/domains/batterytrader.com/public_html/includes/classes/keys.php on line 98'
The info_pages.php line 57 refers to

Code: Select all

      // will always be the first and only item in the returned array
      return $page_arr[0];
    }
and keys.php 97-98

Code: Select all

    $email_title = $key_email['pages_title'];
      $email_text = nl2br($key_email['pages_text']);
Any general pointers of where to look would be great.

David


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Deprecated: nl2br()

Post by burt »

>> I think this is pulling data for info pages

The other way around...it's not pulling data.

The error means that no page is being returned by the page call.
So nothing is being passed to nl2br.

Do you have a page set up with the correct Slug ?
I am not here to build for you.
I am here to build with you. Let's help each other.
BatteryTrader
Contributor
Posts: 156
Joined: Thu Apr 11, 2024 7:18 am
Phoenix Version: 1.1.0.3
Has thanked: 3 times
Been thanked: 17 times

Re: Deprecated: nl2br()

Post by BatteryTrader »

Ok thankyou, I was in the right area.

Turns out it was the Key slug from the S06e08-1.1.0.0

Put it in, and that particular warning seems to have gone now.

Cheers

David


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply