Merge "Stop supporting old versions of composer for ComposerPackageModifier"
[lhc/web/wiklou.git] / includes / actions / RawAction.php
index 69cd7aa..c7b18a4 100644 (file)
@@ -83,7 +83,8 @@ class RawAction extends FormlessAction {
                $response->header( 'Content-type: ' . $contentType . '; charset=UTF-8' );
                // Output may contain user-specific data;
                // vary generated content for open sessions on private wikis
-               $privateCache = !User::isEveryoneAllowed( 'read' ) && ( $smaxage == 0 || session_id() != '' );
+               $privateCache = !User::isEveryoneAllowed( 'read' ) &&
+                       ( $smaxage == 0 || MediaWiki\Session\SessionManager::getGlobalSession()->isPersistent() );
                // Don't accidentally cache cookies if user is logged in (T55032)
                $privateCache = $privateCache || $this->getUser()->isLoggedIn();
                $mode = $privateCache ? 'private' : 'public';
@@ -101,7 +102,7 @@ class RawAction extends FormlessAction {
                        $response->statusHeader( 404 );
                }
 
-               if ( !Hooks::run( 'RawPageViewBeforeOutput', array( &$this, &$text ) ) ) {
+               if ( !Hooks::run( 'RawPageViewBeforeOutput', [ &$this, &$text ] ) ) {
                        wfDebug( __METHOD__ . ": RawPageViewBeforeOutput hook broke raw page output.\n" );
                }
 
@@ -227,7 +228,7 @@ class RawAction extends FormlessAction {
                        }
                }
 
-               $allowedCTypes = array( 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' );
+               $allowedCTypes = [ 'text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit' ];
                if ( $ctype == '' || !in_array( $ctype, $allowedCTypes ) ) {
                        $ctype = 'text/x-wiki';
                }