Do not try to add edit links to the HTML in contexts without a Title

Title may be null when accessed via this->getTitle()
If this is the case we should assume the skin is being used by someone
who is not a reader and in these circumstances, not try to render any
page actions.

Bug: T179833
Change-Id: Ia47fd9b059101bf22b5d31be7df3a332b35d6b24
This commit is contained in:
jdlrobson 2017-11-07 11:57:43 -08:00 committed by Jdlrobson
parent 9fa40f81d8
commit e422eb9a81
1 changed files with 4 additions and 0 deletions

View File

@ -194,6 +194,10 @@ class SkinMinerva extends SkinTemplate implements ICustomizableSkin {
protected function isAllowedPageAction( $action ) {
$title = $this->getTitle();
$config = $this->getConfig();
// Title may be undefined in certain contexts (T179833)
if ( !$title ) {
return false;
}
if (
! in_array( $action, $config->get( 'MinervaPageActions' ) )