Merge branch 'fix/module-info-error-#4092'

This commit is contained in:
Johannes Meyer 2020-03-13 10:32:34 +01:00
commit a921142bc9
1 changed files with 14 additions and 1 deletions

View File

@ -860,7 +860,7 @@ class Module
if (file_exists($this->metadataFile)) {
$key = null;
$file = new File($this->metadataFile, 'r');
foreach ($file as $line) {
foreach ($file as $lineno => $line) {
$line = rtrim($line);
if ($key === 'description') {
@ -875,6 +875,19 @@ class Module
continue;
}
if (strpos($line, ':') === false) {
Logger::debug(
$this->translate(
"Can't process line %d in %s: Line does not specify a key:value pair"
. " nor is it part of the description (indented with a single space)"
),
$lineno,
$this->metadataFile
);
break;
}
list($key, $val) = preg_split('/:\s+/', $line, 2);
$key = lcfirst($key);