From 2e6587f7e513ec50e118cb0a49ae42438cd20e02 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 2 Nov 2015 15:52:37 -0800 Subject: [PATCH] Avoid "headers already sent" error in jobs for UseDC cookie Bug: T115413 Change-Id: Ic6050bef04adbda2557422bf60b2ebe300c89629 --- includes/specials/SpecialRunJobs.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/includes/specials/SpecialRunJobs.php b/includes/specials/SpecialRunJobs.php index 286a745653..4217553764 100644 --- a/includes/specials/SpecialRunJobs.php +++ b/includes/specials/SpecialRunJobs.php @@ -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... -- 2.20.1