From 6508042ec259dc09936de755624e9e4b7eb1fcb7 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 9 Feb 2017 19:39:10 +0100 Subject: [PATCH] fixed issue when settings contain a ": " --- lam/lib/config.inc | 2 +- lam/tests/lib/LAMConfigTest.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lam/lib/config.inc b/lam/lib/config.inc index 5a97ced8..9fc3cda9 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -624,7 +624,7 @@ class LAMConfig { // empty global settings $this->$keyword = ''; } - elseif (sizeof($parts) == 2) { + elseif ((sizeof($parts) > 1) && !in_array($keyword, array('modules', 'types', 'tools', 'jobs'))) { // global setting with value $this->$keyword = substr($line, $startIndex); } diff --git a/lam/tests/lib/LAMConfigTest.php b/lam/tests/lib/LAMConfigTest.php index 5328ef7a..747f1c50 100644 --- a/lam/tests/lib/LAMConfigTest.php +++ b/lam/tests/lib/LAMConfigTest.php @@ -552,6 +552,17 @@ class LAMConfigTest extends PHPUnit_Framework_TestCase { $this->assertEquals($val, $this->lAMConfig->getLamProMailText()); } + /** + * Tests LAMConfig->getLamProMailText() and LAMConfig->setLamProMailText() with a value that contains ": " + */ + public function testLamProMailTextColoon() { + $val = 'some: @@uid@@\r\ntext'; + $this->lAMConfig->setLamProMailText($val); + $this->assertEquals($val, $this->lAMConfig->getLamProMailText()); + $this->doSave(); + $this->assertEquals($val, $this->lAMConfig->getLamProMailText()); + } + /** * Tests LAMConfig->getJobsBindUser() and LAMConfig->setJobsBindUser() */