Tracks in Patient Summary not displaying with php 8.1

Tracks in Patient Summary not displaying properly with php 8.1. This displays correctly with
php 7.4.

As a temporary fix, I commented out line 45 of track_anything_fragment.php.

echo text($result);

OpenEMR Version
I’m using OpenEMR version 7.0.0 (1)

I’m using: Google Chrome Version 104.0.5112.101 (Official Build) (64-bit) and Firefox 104.0

Operating System
I’m using: Ubuntu 22.04 (LTS)

[Wed Aug 17 11:06:01.571834 2022] [php:notice] [pid 8613] [client] PHP Fatal error: Uncaught TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given in /var/www/html/openemr/library/\nStack trace:\n#0 /var/www/html/openemr/library/ htmlspecialchars()\n#1 /var/www/html/openemr/interface/patient_file/summary/track_anything_fragment.php(45): text()\n#2 {main}\n thrown in /var/www/html/openemr/library/ on line 115, referer: http://localhost/openemr/interface/patient_file/summary/demographics.php