Merge branch 'Wikidata' into master.
[lhc/web/wiklou.git] / includes / OutputPage.php
index 02f22d9..53f6da1 100644 (file)
@@ -1993,7 +1993,9 @@ class OutputPage extends ContextSource {
                wfRunHooks( 'AfterFinalPageOutput', array( $this ) );
 
                $this->sendCacheControl();
+
                ob_end_flush();
+
                wfProfileOut( __METHOD__ );
        }
 
@@ -2071,8 +2073,6 @@ class OutputPage extends ContextSource {
         * @param $action String: action that was denied or null if unknown
         */
        public function showPermissionsErrorPage( $errors, $action = null ) {
-               global $wgGroupPermissions;
-
                // For some action (read, edit, create and upload), display a "login to do this action"
                // error if all of the following conditions are met:
                // 1. the user is not logged in
@@ -2081,8 +2081,8 @@ class OutputPage extends ContextSource {
                if ( in_array( $action, array( 'read', 'edit', 'createpage', 'createtalk', 'upload' ) )
                        && $this->getUser()->isAnon() && count( $errors ) == 1 && isset( $errors[0][0] )
                        && ( $errors[0][0] == 'badaccess-groups' || $errors[0][0] == 'badaccess-group0' )
-                       && ( ( isset( $wgGroupPermissions['user'][$action] ) && $wgGroupPermissions['user'][$action] )
-                       || ( isset( $wgGroupPermissions['autoconfirmed'][$action] ) && $wgGroupPermissions['autoconfirmed'][$action] ) )
+                       && ( User::groupHasPermission( 'user', $action )
+                       || User::groupHasPermission( 'autoconfirmed', $action ) )
                ) {
                        $displayReturnto = null;