Added dollar escape $ and a way to force end variables with ^_^

This commit is contained in:
frikky
2021-09-04 19:22:51 +02:00
parent bfb0e70866
commit cd555c840c
2 changed files with 21 additions and 2 deletions
+20 -1
View File
@@ -1594,7 +1594,19 @@ class AppBase:
# JSON / yaml etc shouldn't have spaces in their fields anyway.
#match = ".*?([$]{1}([a-zA-Z0-9 _-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,})[$/, ]?"
#match = ".*?([$]{1}([a-zA-Z0-9 _-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,})"
match = ".*?([$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,})" # Removed space - no longer ok
match = ".*?([$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,})" # Removed space - no longer ok. Force underscore.
# Extra replacements for certain scenarios
escaped_dollar = "\\$"
escape_replacement = "\\%\\%\\%\\%\\%"
end_variable = "^_^"
print("Input value: %s" % parameter["value"])
try:
parameter["value"] = parameter["value"].replace(escaped_dollar, escape_replacement, -1)
except:
print("Error in initial replacement!")
# Regex to find all the things
if parameter["variant"] == "STATIC_VALUE":
@@ -1725,6 +1737,13 @@ class AppBase:
pass
#print("POST liquid: %s" % parameter["value"])
try:
parameter["value"] = parameter["value"].replace(end_variable, "", -1)
parameter["value"] = parameter["value"].replace(escape_replacement, escaped_dollar, -1)
except:
print("Error in datareplacement")
pass
return "", parameter["value"], is_loop
def run_validation(sourcevalue, check, destinationvalue):
+1 -1
View File
@@ -3,7 +3,7 @@
### DEFAULT
NAME=shuffle-app_sdk
VERSION=0.9.12
VERSION=0.9.14
docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force
docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION