fix(core): 🐛 pass namespace key as string

When the namespace key only consists of number, it can cause a TypeError.

Fixes: #849
This commit is contained in:
alistair3149 2024-05-18 19:47:30 -04:00 committed by GitHub
parent b9225057a7
commit f781773cba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -287,7 +287,7 @@ class SkinHooks implements
// 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';
}
}