mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
global-functions: $ParseKeyValueStore: allow equals sign in value
This commit is contained in:
@@ -423,8 +423,6 @@
|
||||
|
||||
# parse key value store
|
||||
:set ParseKeyValueStore do={
|
||||
:global CharacterReplace;
|
||||
|
||||
:local Source $1;
|
||||
:if ([ :typeof $Source ] != "array") do={
|
||||
:set Source [ :tostr $1 ];
|
||||
@@ -432,8 +430,8 @@
|
||||
:local Result [ :toarray "" ];
|
||||
:foreach KeyValue in=[ :toarray $Source ] do={
|
||||
:if ([ :find $KeyValue "=" ]) do={
|
||||
:set KeyValue [ :toarray [ $CharacterReplace $KeyValue "=" "," ] ];
|
||||
:set ($Result->($KeyValue->0)) ($KeyValue->1);
|
||||
:set ($Result->[ :pick $KeyValue 0 [ :find $KeyValue "=" ] ]) \
|
||||
[ :pick $KeyValue ([ :find $KeyValue "=" ] + 1) [ :len $KeyValue ] ];
|
||||
} else={
|
||||
:set ($Result->$KeyValue) true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user