Merge branch 'Wikidata' into master.
[lhc/web/wiklou.git] / includes / OutputPage.php
index a2e2670..53f6da1 100644 (file)
@@ -255,7 +255,7 @@ class OutputPage extends ContextSource {
        function __construct( IContextSource $context = null ) {
                if ( $context === null ) {
                        # Extensions should use `new RequestContext` instead of `new OutputPage` now.
-                       wfDeprecated( __METHOD__ );
+                       wfDeprecated( __METHOD__, '1.18' );
                } else {
                        $this->setContext( $context );
                }
@@ -1902,7 +1902,7 @@ class OutputPage extends ContextSource {
         * @deprecated since 1.18 Use HttpStatus::getMessage() instead.
         */
        public static function getStatusMessage( $code ) {
-               wfDeprecated( __METHOD__ );
+               wfDeprecated( __METHOD__, '1.18' );
                return HttpStatus::getMessage( $code );
        }
 
@@ -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;