Skip to content

Commit

Permalink
TPCFmtMsg: Correctly check for h1 index types.
Browse files Browse the repository at this point in the history
PHP 8.1 introduces warnings when using undefined array keys, which
finally pointed out this bug after almost 9½ years.
  • Loading branch information
nmlgc committed Dec 22, 2022
1 parent b62bee6 commit ad1a7f4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions hooks/TPCFmtMsg.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ public static function onMsg( &$tpcState, &$title, &$temp ) {
$type = ( $temp->params[1] ?? null );

// h1 index hack... meh.
if ( $temp->params[1] === 'h1') {
$indexType = 'h1';
} else {
$indexType = null;
}
$indexType = ( ( $type === "h1" ) ? "h1" : null );

// Time index
$timeIndex = &$tpcState->msgTimeIndex[$indexType];
Expand Down

0 comments on commit ad1a7f4

Please sign in to comment.