Use quickUserCan instead of userCan for searches
authorJackmcbarn <jackmcbarn@gmail.com>
Wed, 18 Jun 2014 17:37:14 +0000 (13:37 -0400)
committerJackmcbarn <jackmcbarn@gmail.com>
Wed, 18 Jun 2014 17:39:22 +0000 (13:39 -0400)
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

includes/specials/SpecialSearch.php

index 1cc5930..f44703c 100644 (file)
@@ -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';