Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/treetrek.git

Fixes null pointer issue

Author Dave Jarvis <email>
Date 2026-02-15 00:10:19 GMT-0800
Commit 45a03f48a09c49cdf7bf0cb204b90eaaf11e94f9
Parent 47c894c
render/Highlighter.php
$combined = '~' . implode( '|', $patterns ) . '~msu';
- return preg_replace_callback( $combined, function( $matches ) {
+ $result = preg_replace_callback( $combined, function( $matches ) {
foreach( $matches as $key => $value ) {
if( !is_numeric( $key ) && $value !== '' ) {
return htmlspecialchars( $matches[0] );
}, $this->content );
+
+ return $result ?? htmlspecialchars( $this->content );
}
Delta 3 lines added, 1 line removed, 2-line increase