From: Jackmcbarn Date: Wed, 18 Jun 2014 17:37:14 +0000 (-0400) Subject: Use quickUserCan instead of userCan for searches X-Git-Tag: 1.31.0-rc.0~15275^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=a1367b219933139d6279a439aac0f6a7e1aecaf6 Use quickUserCan instead of userCan for searches When displaying search results, use quickUserCan instead of userCan when checking whether the user can create the page they searched for. This will result in things like the titleblacklist still letting users proceed to the edit window, so that they can see the custom error message, rather than having no idea why they can't create the page. Change-Id: Idb428703bb69a83e04bb05df1e7106b6db7bda45 --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 1cc5930ac7..f44703c314 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -449,7 +449,7 @@ class SpecialSearch extends SpecialPage { if ( $title->isKnown() ) { $messageName = 'searchmenu-exists'; - } elseif ( $title->userCan( 'create', $this->getUser() ) ) { + } elseif ( $title->quickUserCan( 'create', $this->getUser() ) ) { $messageName = 'searchmenu-new'; } else { $messageName = 'searchmenu-new-nocreate';