Skip to content

Commit

Permalink
fix(core): 🐛 pass namespace key as string
Browse files Browse the repository at this point in the history
When the namespace key only consists of number, it can cause a TypeError.

Fixes: #849
  • Loading branch information
alistair3149 authored May 18, 2024
1 parent b922505 commit f781773
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/Hooks/SkinHooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ private static function updateAssociatedPagesMenu( &$links ) {
// Since talk keys have namespace as prefix
foreach ( $links['associated-pages'] as $key => $item ) {
// I wish I can use str_ends_with but need to wait for PHP 7.X to be dropped
if ( substr( $key, -4 ) === 'talk' ) {
if ( substr( (string)$key, -4 ) === 'talk' ) {
$links['associated-pages'][$key]['icon'] = 'speechBubbles';
}
}
Expand Down

0 comments on commit f781773

Please sign in to comment.