Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/278339

Change subject: Avoid double-rendering on late exceptions
......................................................................

Avoid double-rendering on late exceptions

Bug: T129657
Change-Id: I86af834b842bc056b57b2a55a9e1385481d5781d
---
M includes/OutputPage.php
1 file changed, 13 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/39/278339/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index 6774072..cffa744 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -2315,11 +2315,21 @@
                        // adding of CSS or Javascript by extensions.
                        Hooks::run( 'BeforePageDisplay', [ &$this, &$sk ] );
 
-                       $sk->outputPage();
+                       try {
+                               $sk->outputPage();
+                       } catch ( Exception $e ) {
+                               ob_end_clean(); // bug T129657
+                               throw $e;
+                       }
                }
 
-               // This hook allows last minute changes to final overall output 
by modifying output buffer
-               Hooks::run( 'AfterFinalPageOutput', [ $this ] );
+               try {
+                       // This hook allows last minute changes to final 
overall output by modifying output buffer
+                       Hooks::run( 'AfterFinalPageOutput', [ $this ] );
+               } catch ( Exception $e ) {
+                       ob_end_clean(); // bug T129657
+                       throw $e;
+               }
 
                $this->sendCacheControl();
 

-- 
To view, visit https://gerrit.wikimedia.org/r/278339
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I86af834b842bc056b57b2a55a9e1385481d5781d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to