Avoid "headers already sent" error in jobs for UseDC cookie
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 2 Nov 2015 23:52:37 +0000 (15:52 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 3 Nov 2015 04:22:40 +0000 (20:22 -0800)
Bug: T115413
Change-Id: Ic6050bef04adbda2557422bf60b2ebe300c89629

includes/specials/SpecialRunJobs.php

index 286a745..4217553 100644 (file)
@@ -86,6 +86,13 @@ class SpecialRunJobs extends UnlistedSpecialPage {
                        ob_flush();
                        flush();
                        // Once the client receives this response, it can disconnect
+                       set_error_handler( function ( $errno, $errstr ) {
+                               if ( strpos( $errstr, 'Cannot modify header information' ) !== false ) {
+                                       return true; // bug T115413
+                               }
+                               // Delegate unhandled errors to the default handlers
+                               return false;
+                       } );
                }
 
                // Do all of the specified tasks...