X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FWebStart.php;h=957309137eb67b5877e36270e94139d357eece55;hb=b120fa48410839773877ae4434e031203f0c1ecf;hp=878dd3eca55f85b9480fb5e0fae9d5fb17fb40e5;hpb=b1b0070dc7557311cc38e7cc99e4231ac4b92940;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebStart.php b/includes/WebStart.php index 878dd3eca5..957309137e 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -50,6 +50,7 @@ if ( !defined( 'MW_CONFIG_CALLBACK' ) ) { define( 'MW_CONFIG_FILE', "$IP/LocalSettings.php" ); } if ( !is_readable( MW_CONFIG_FILE ) ) { + function wfWebStartNoLocalSettings() { # LocalSettings.php is the per-site customization file. If it does not exist # the wiki installer needs to be launched or the generated file uploaded to @@ -58,12 +59,14 @@ if ( !defined( 'MW_CONFIG_CALLBACK' ) ) { require_once "$IP/includes/NoLocalSettings.php"; die(); } + define( 'MW_CONFIG_CALLBACK', 'wfWebStartNoLocalSettings' ); } } // Custom setup for WebStart entry point if ( !defined( 'MW_SETUP_CALLBACK' ) ) { + function wfWebStartSetup() { // Initialise output buffering // Check for previously set up buffers, to avoid a mix of gzip and non-gzip output. @@ -71,6 +74,7 @@ if ( !defined( 'MW_SETUP_CALLBACK' ) ) { ob_start( 'MediaWiki\\OutputHandler::handle' ); } } + define( 'MW_SETUP_CALLBACK', 'wfWebStartSetup' ); } @@ -87,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();