From: Timo Tijhof Date: Sun, 25 Aug 2019 18:15:34 +0000 (+0100) Subject: WebStart: Avoid DB or uselang for nonwrite-api-promise-error message X-Git-Tag: 1.34.0-rc.0~548^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=a8d5c4c88a5a4a59846a3587809a94ace242f285;p=lhc%2Fweb%2Fwiklou.git 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 --- 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();