Make the code easier to reason about by not involving global state from
LBFactory, RequestContext, SessionManager, and User.
Bug: T189966
Change-Id: I88d2bf58ebd481009ce295335d730a34dbb277fb
header( 'Cache-Control: no-cache' );
header( 'Content-Type: text/html; charset=utf-8' );
HttpStatus::header( 400 );
- $error = wfMessage( 'nonwrite-api-promise-error' )->escaped();
- $content = <<<EOT
+ $errorHtml = wfMessage( 'nonwrite-api-promise-error' )
+ ->useDatabase( false )
+ ->inContentLanguage()
+ ->escaped();
+ $content = <<<HTML
<!DOCTYPE html>
<html>
<head><meta charset="UTF-8" /></head>
<body>
-$error
+$errorHtml
</body>
</html>
-EOT;
+HTML;
header( 'Content-Length: ' . strlen( $content ) );
echo $content;
die();