From e9f801df5397bf918cb55601f6f77af8922b6cff Mon Sep 17 00:00:00 2001
From: hahn <axel.hahn@iml.unibe.ch>
Date: Wed, 19 Dec 2018 11:05:07 +0100
Subject: [PATCH] task-2494 ... show a warning on |- in config replacement
 section

---
 .../deployment/classes/config-replacement.class.php   | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/public_html/deployment/classes/config-replacement.class.php b/public_html/deployment/classes/config-replacement.class.php
index bab95194..cacacc6c 100644
--- a/public_html/deployment/classes/config-replacement.class.php
+++ b/public_html/deployment/classes/config-replacement.class.php
@@ -169,7 +169,7 @@ class configreplacement {
             'method'=>'GET',
         ));
         
-        // HACK: minify YAML of the host ... because it is too large for SPYC parser
+        // HACK: minify YAML of the host ... because it is too large for SPYC parser?
         $sPart="---\n";
         $bCopy=false;
         foreach(explode("\n", $aData['body']) as $sLine){
@@ -193,9 +193,16 @@ class configreplacement {
             }
             // echo 'DEBUG: '.($bCopy ? 'COPY':'SKIP').$sLine.'<br>';
         }
-
+        if (strstr($sPart, '|-')){
+            echo 'WARNING: the chars &quot;|-&quot; were found:<br><pre> '
+            .str_replace('|-', '<span class="replace">|-</span>', $sPart)
+            .'</pre><br>';
+        }
         require_once __DIR__.'./../../vendor/spyc/spyc.php';
+        
+        // echo 'DEBUG: <pre>'.print_r(spyc_load($aData['body']), 1).'</pre>';
         $aYaml=spyc_load($sPart);
+        // echo 'DEBUG: <pre>'.print_r($aYaml, 1).'</pre>';
 
         $aReturn=array();
         foreach ($aYaml as $aProject){
-- 
GitLab