mediawiki.feedback: Set the message input to be autosized
[lhc/web/wiklou.git] / includes / MediaWiki.php
index 431397f..3b463ae 100644 (file)
@@ -393,7 +393,11 @@ class MediaWiki {
                if ( $action instanceof Action ) {
                        # Let Squid cache things if we can purge them.
                        if ( $this->config->get( 'UseSquid' ) &&
-                               in_array( $request->getFullRequestURL(), $requestTitle->getSquidURLs() )
+                               in_array(
+                                       // Use PROTO_INTERNAL because that's what getSquidURLs() uses
+                                       wfExpandUrl( $request->getRequestURL(), PROTO_INTERNAL ),
+                                       $requestTitle->getSquidURLs()
+                               )
                        ) {
                                $output->setSquidMaxage( $this->config->get( 'SquidMaxage' ) );
                        }
@@ -485,6 +489,19 @@ class MediaWiki {
                $action = $this->getAction();
                $wgTitle = $title;
 
+               $trxProfiler = Profiler::instance()->getTransactionProfiler();
+
+               // Aside from rollback, master queries should not happen on GET requests.
+               // Periodic or "in passing" updates on GET should use the job queue.
+               if ( !$request->wasPosted()
+                       && in_array( $action, array( 'view', 'edit', 'history' ) )
+               ) {
+                       $trxProfiler->setExpectation( 'masterConns', 0, __METHOD__ );
+                       $trxProfiler->setExpectation( 'writes', 0, __METHOD__ );
+               } else {
+                       $trxProfiler->setExpectation( 'maxAffected', 500, __METHOD__ );
+               }
+
                // If the user has forceHTTPS set to true, or if the user
                // is in a group requiring HTTPS, or if they have the HTTPS
                // preference set, redirect them to HTTPS.
@@ -571,6 +588,10 @@ class MediaWiki {
         * Ends this task peacefully
         */
        public function restInPeace() {
+               // Ignore things like master queries/connections on GET requests
+               // as long as they are in deferred updates (which catch errors).
+               Profiler::instance()->getTransactionProfiler()->resetExpectations();
+
                // Do any deferred jobs
                DeferredUpdates::doUpdates( 'commit' );