mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-13 17:49:25 +00:00
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:
parent
b9225057a7
commit
f781773cba
|
@ -287,7 +287,7 @@ class SkinHooks implements
|
||||||
// Since talk keys have namespace as prefix
|
// Since talk keys have namespace as prefix
|
||||||
foreach ( $links['associated-pages'] as $key => $item ) {
|
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
|
// 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';
|
$links['associated-pages'][$key]['icon'] = 'speechBubbles';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue