}
}
- $json = FormatJson::encode( (object)$messages );
+ $json = FormatJson::encode( (object)$messages, false, FormatJson::UTF8_OK );
// @codeCoverageIgnoreStart
if ( $json === false ) {
$this->logger->warning( 'Failed to encode message blob for {module} ({lang})', [
}
if ( $versionHash !== '' && strlen( $versionHash ) !== 7 ) {
- $this->getLogger()->warning(
- "Module '{module}' produced an invalid version hash: '{version}'.",
+ $e = new RuntimeException( "Badly formatted module version hash" );
+ $resourceLoader->outputErrorAndLog( $e,
+ "Module '{module}' produced an invalid version hash: '{version}'.",
[
'module' => $name,
'version' => $versionHash,
'upload-form-label-usage-filename',
'action-upload',
'apierror-mustbeloggedin',
+ 'apierror-permissiondenied',
'badaccess-groups',
'apierror-timeout',
'apierror-offline',
);
}
- public function testVersionHash() {
- $data = self::getAllModules();
- foreach ( $data['modules'] as $moduleName => $module ) {
- $version = $module->getVersionHash( $data['context'] );
- $this->assertEquals( 7, strlen( $version ), "$moduleName must use ResourceLoader::makeHash" );
- }
- }
-
/**
* Verify that all modules specified as dependencies of other modules actually
* exist and are not illegal.