resourceloader: Use upsert() instead of replace() for module_deps write
[lhc/web/wiklou.git] / includes / Title.php
index 65b69a2..3ce775b 100644 (file)
@@ -1233,12 +1233,6 @@ class Title implements LinkTarget {
                        && ( $this->hasContentModel( CONTENT_MODEL_CSS )
                                || $this->hasContentModel( CONTENT_MODEL_JAVASCRIPT ) );
 
-               # @note This hook is also called in ContentHandler::getDefaultModel.
-               #   It's called here again to make sure hook functions can force this
-               #   method to return true even outside the MediaWiki namespace.
-
-               Hooks::run( 'TitleIsCssOrJsPage', [ $this, &$isCssOrJsPage ], '1.25' );
-
                return $isCssOrJsPage;
        }
 
@@ -2423,7 +2417,7 @@ class Title implements LinkTarget {
         *
         * @param string $action The action to check
         * @param bool $short Short circuit on first error
-        * @return array List of errors
+        * @return array Array containing an error message key and any parameters
         */
        private function missingPermissionError( $action, $short ) {
                // We avoid expensive display logic for quickUserCan's and such
@@ -2431,19 +2425,7 @@ class Title implements LinkTarget {
                        return [ 'badaccess-group0' ];
                }
 
-               $groups = array_map( [ 'User', 'makeGroupLinkWiki' ],
-                       User::getGroupsWithPermission( $action ) );
-
-               if ( count( $groups ) ) {
-                       global $wgLang;
-                       return [
-                               'badaccess-groups',
-                               $wgLang->commaList( $groups ),
-                               count( $groups )
-                       ];
-               } else {
-                       return [ 'badaccess-group0' ];
-               }
+               return User::newFatalPermissionDeniedStatus( $action )->getErrorsArray()[0];
        }
 
        /**