LegacyConfig: fix info_url parsing and rendering

fixes #71
This commit is contained in:
Thomas Gelf 2017-01-23 23:38:43 +01:00
parent 4d912dffc3
commit 051f9376b7
2 changed files with 10 additions and 3 deletions

View file

@ -211,6 +211,9 @@ class LegacyConfigParser
case 'info_url':
$this->parseInfoUrl($line, $bp);
break;
case 'template':
// compat, ignoring for now
break;
default:
return false;
}
@ -239,14 +242,18 @@ class LegacyConfigParser
return;
}
// Semicolon found in the first 14 cols? Might be a line with extra information
$pos = strpos($line, ';');
// Space found in the first 14 cols? Might be a line with extra information
$pos = strpos($line, ' ');
if ($pos !== false && $pos < 14) {
if ($this->parseExtraLine($line, $pos, $bp)) {
return;
}
}
if (strpos($line, '=') === false) {
$this->parseError('Got invalid line');
}
list($name, $value) = preg_split('~\s*=\s*~', $line, 2);
if (strpos($name, ';') !== false) {

View file

@ -215,7 +215,7 @@ class LegacyConfigRenderer
{
if ($node->hasInfoUrl()) {
return sprintf(
"info_url;%s;%s\n",
"info_url %s;%s\n",
$node->getName(),
$node->getInfoUrl()
);