From 051f9376b71f6c82a3073908db5e0cd82854a8c3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Mon, 23 Jan 2017 23:38:43 +0100 Subject: [PATCH] LegacyConfig: fix info_url parsing and rendering fixes #71 --- .../Businessprocess/Storage/LegacyConfigParser.php | 11 +++++++++-- .../Businessprocess/Storage/LegacyConfigRenderer.php | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/library/Businessprocess/Storage/LegacyConfigParser.php b/library/Businessprocess/Storage/LegacyConfigParser.php index a93ead2..5f01d24 100644 --- a/library/Businessprocess/Storage/LegacyConfigParser.php +++ b/library/Businessprocess/Storage/LegacyConfigParser.php @@ -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) { diff --git a/library/Businessprocess/Storage/LegacyConfigRenderer.php b/library/Businessprocess/Storage/LegacyConfigRenderer.php index c33265d..57bb1fb 100644 --- a/library/Businessprocess/Storage/LegacyConfigRenderer.php +++ b/library/Businessprocess/Storage/LegacyConfigRenderer.php @@ -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() );