From a9c3990fa7db53fb3335d7f95dbcf3da62880600 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Fri, 11 Jan 2008 11:14:32 +0000 Subject: * now accepts \n and \t in values and converts them to the respective real thing (newline or tab) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1459 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'config-db') diff --git a/config-db/slxconfig b/config-db/slxconfig index d59215ed..11e1d602 100755 --- a/config-db/slxconfig +++ b/config-db/slxconfig @@ -190,12 +190,18 @@ sub parseKeyValueArgs } my $key = lc($1); my $value = $2; - if ($value eq '-') { - $value = undef; - } if (!grep { $_ eq $key } @$allowedKeys) { die _tr("unknown key '%s' specified for %s\n", $key, $table); } + + if ($value eq '-') { + $value = undef; + } + + # replace escaped newlines and tab chars by the respective real thing + $value =~ s{\\n}{\n}gms; + $value =~ s{\\t}{\t}gms; + $dataHash{$key} = $value; } @@ -221,6 +227,11 @@ sub parseKeyValueArgsWithAttrs if ($value eq '-') { $value = undef; } + + # replace escaped newlines and tab chars by the respective real thing + $value =~ s{\\n}{\n}gms; + $value =~ s{\\t}{\t}gms; + if (grep { $_ eq $key } @$allowedKeys) { $dataHash{$key} = $value; } elsif (grep { $_ eq $key } @$allowedAttrKeys) { -- cgit v1.2.3-55-g7522