From: Marius Hoch Date: Fri, 21 Apr 2017 15:06:51 +0000 (+0200) Subject: Check supportsDirectEditing when suggesting page creation X-Git-Tag: 1.31.0-rc.0~3377^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=da67131606b3475d67ed14c3f4608d88816609cf;p=lhc%2Fweb%2Fwiklou.git Check supportsDirectEditing when suggesting page creation on Special:Search. If the linked page is not going to be editable directly, rather not suggest the user to create it. Bug: T58032 Change-Id: I28f16c93b8efd9bfa360e3f9c6d6e65e5a927c42 --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 139e4f70c3..3a931075b2 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -475,7 +475,9 @@ class SpecialSearch extends SpecialPage { if ( $title->isKnown() ) { $messageName = 'searchmenu-exists'; $linkClass = 'mw-search-exists'; - } elseif ( $title->quickUserCan( 'create', $this->getUser() ) ) { + } elseif ( ContentHandler::getForTitle( $title )->supportsDirectEditing() + && $title->quickUserCan( 'create', $this->getUser() ) + ) { $messageName = 'searchmenu-new'; } }