From a8d5c4c88a5a4a59846a3587809a94ace242f285 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 25 Aug 2019 19:15:34 +0100 Subject: [PATCH] WebStart: Avoid DB or uselang for nonwrite-api-promise-error message Make the code easier to reason about by not involving global state from LBFactory, RequestContext, SessionManager, and User. Bug: T189966 Change-Id: I88d2bf58ebd481009ce295335d730a34dbb277fb --- includes/WebStart.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/includes/WebStart.php b/includes/WebStart.php index c83fdea511..957309137e 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -91,17 +91,20 @@ if ( !defined( 'MW_API' ) && header( 'Cache-Control: no-cache' ); header( 'Content-Type: text/html; charset=utf-8' ); HttpStatus::header( 400 ); - $error = wfMessage( 'nonwrite-api-promise-error' )->escaped(); - $content = <<useDatabase( false ) + ->inContentLanguage() + ->escaped(); + $content = << -$error +$errorHtml -EOT; +HTML; header( 'Content-Length: ' . strlen( $content ) ); echo $content; die(); -- 2.20.1