Alex Monk has uploaded a new change for review.

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

Change subject: MWExceptionRenderer::useOutputPage: Don't bother in RL code
......................................................................

MWExceptionRenderer::useOutputPage: Don't bother in RL code

Change-Id: Ieb6d682a9f2fb4def4c01908ccd035fcce2e1895
---
M includes/exception/MWExceptionRenderer.php
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/62/312962/1

diff --git a/includes/exception/MWExceptionRenderer.php 
b/includes/exception/MWExceptionRenderer.php
index e242da3..d5df8dd 100644
--- a/includes/exception/MWExceptionRenderer.php
+++ b/includes/exception/MWExceptionRenderer.php
@@ -134,8 +134,12 @@
         */
        private static function useOutputPage( $e ) {
                // Can the extension use the Message class/wfMessage to get 
i18n-ed messages?
+               // Don't even bother with OutputPage if the exception occurred 
in ResourceLoader,
+               // it won't have Title context set so the Skin system (and 
probably most of MediaWiki)
+               // won't work.
+               $badClasses = [ 'LocalisationCache', 'ResourceLoader' ];
                foreach ( $e->getTrace() as $frame ) {
-                       if ( isset( $frame['class'] ) && $frame['class'] === 
'LocalisationCache' ) {
+                       if ( isset( $frame['class'] )  && in_array( 
$frame['class'], $badClasses ) ) {
                                return false;
                        }
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieb6d682a9f2fb4def4c01908ccd035fcce2e1895
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <a...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to