mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-31 06:03:04 +02:00
Replace all escaped slashes in json strings (closes #866)
${var/pattern/string} will only replace the first occurence. We should
use ${var//pattern/string} to replace all escaped slashes.
This commit is contained in:
committed by
Lukas Schauer
parent
fa68ad8b23
commit
67b111a7b0
@@ -217,7 +217,7 @@ jsonsh() {
|
|||||||
'[') parse_array "$jpath" ;;
|
'[') parse_array "$jpath" ;;
|
||||||
# At this point, the only valid single-character tokens are digits.
|
# At this point, the only valid single-character tokens are digits.
|
||||||
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
|
''|[!0-9]) throw "EXPECTED value GOT ${token:-EOF}" ;;
|
||||||
*) value="${token/\\\///}"
|
*) value="${token//\\\///}"
|
||||||
# replace solidus ("\/") in json strings with normalized value: "/"
|
# replace solidus ("\/") in json strings with normalized value: "/"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
Reference in New Issue
Block a user