Tracks in Patient Summary not displaying with php 8.1

Situation
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)

Browser:
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)

Logs
[Wed Aug 17 11:06:01.571834 2022] [php:notice] [pid 8613] [client 127.0.0.1:46102] PHP Fatal error: Uncaught TypeError: htmlspecialchars(): Argument #1 ($string) must be of type string, array given in /var/www/html/openemr/library/htmlspecialchars.inc.php:115\nStack trace:\n#0 /var/www/html/openemr/library/htmlspecialchars.inc.php(115): 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/htmlspecialchars.inc.php on line 115, referer: http://localhost/openemr/interface/patient_file/summary/demographics.php