GitInfo: Don't try shelling out if it's disabled
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 1642377..bcc3633 100644 (file)
@@ -104,7 +104,7 @@ class MediaWiki {
                if ( $ret === null || !$ret->isSpecialPage() ) {
                        // We can have urls with just ?diff=,?oldid= or even just ?diff=
                        $oldid = $request->getInt( 'oldid' );
-                       $oldid = $oldid ? $oldid : $request->getInt( 'diff' );
+                       $oldid = $oldid ?: $request->getInt( 'diff' );
                        // Allow oldid to override a changed or missing title
                        if ( $oldid ) {
                                $rev = Revision::newFromId( $oldid );
@@ -426,7 +426,7 @@ class MediaWiki {
                        // If $target is set, then a hook wanted to redirect.
                        if ( !$ignoreRedirect && ( $target || $page->isRedirect() ) ) {
                                // Is the target already set by an extension?
-                               $target = $target ? $target : $page->followRedirect();
+                               $target = $target ?: $page->followRedirect();
                                if ( is_string( $target ) ) {
                                        if ( !$this->config->get( 'DisableHardRedirects' ) ) {
                                                // we'll need to redirect
@@ -631,7 +631,8 @@ class MediaWiki {
 
                // Record ChronologyProtector positions for DBs affected in this request at this point
                $cpIndex = null;
-               $lbFactory->shutdown( $flags, $postCommitWork, $cpIndex );
+               $cpClientId = null;
+               $lbFactory->shutdown( $flags, $postCommitWork, $cpIndex, $cpClientId );
                wfDebug( __METHOD__ . ': LBFactory shutdown completed' );
 
                if ( $cpIndex > 0 ) {
@@ -639,7 +640,7 @@ class MediaWiki {
                                $now = time();
                                $expires = $now + ChronologyProtector::POSITION_COOKIE_TTL;
                                $options = [ 'prefix' => '' ];
-                               $value = LBFactory::makeCookieValueFromCPIndex( $cpIndex, $now ); // T190082
+                               $value = LBFactory::makeCookieValueFromCPIndex( $cpIndex, $now, $cpClientId );
                                $request->response()->setCookie( 'cpPosIndex', $value, $expires, $options );
                        }
 
@@ -722,6 +723,9 @@ class MediaWiki {
                        MWExceptionHandler::rollbackMasterChangesAndLog( $e );
                }
 
+               // Disable WebResponse setters for post-send processing (T191537).
+               WebResponse::disableForPostSend();
+
                $blocksHttpClient = true;
                // Defer everything else if possible...
                $callback = function () use ( $mode, &$blocksHttpClient ) {