Commit 0060e478 authored by Tripple Moon's avatar Tripple Moon

Fix two E_NOTICEs when the Echo extension is not installed

PHP Notice:  Undefined index: notifications-alert in /var/www/html/mediawiki-1.31.0/skins/Liberty/LibertyTemplate.php on line 638
PHP Notice:  Undefined index: notifications-message in /var/www/html/mediawiki-1.31.0/skins/Liberty/LibertyTemplate.php on line 639
parent 16851a29
......@@ -635,8 +635,16 @@ class LibertyTemplate extends BaseTemplate {
*/
protected function getNotification() {
$personalTools = $this->getPersonalTools();
$notiCount = $personalTools['notifications-alert']['links'][0]['text'] +
$personalTools['notifications-message']['links'][0]['text'];
$notiCount = 0;
if (
isset( $personalTools['notifications-alert'] ) &&
$personalTools['notifications-alert'] &&
isset( $personalTools['notifications-message'] ) &&
$personalTools['notifications-message']
) {
$notiCount = $personalTools['notifications-alert']['links'][0]['text'] +
$personalTools['notifications-message']['links'][0]['text'];
}
if ( $notiCount ) {
?>
<div id="pt-notifications" class="navbar-notification">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment