Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(manager): deprecate SB_DEFAULT_SERVER_NAME on install #1498

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Only escape what is needed.
  • Loading branch information
fortuna committed Feb 5, 2024
commit 0afb1273a6d8ea3d6cc009b245261bf7cfff5a4a
27 changes: 13 additions & 14 deletions src/server_manager/install_scripts/install_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -551,20 +551,19 @@ function escape_json_string() {
local char="${input:i:1}"
local escaped="${char}"
case "${char}" in
# List from https://www.json.org/.
$'"' ) escaped="\\\"";;
$'\\') escaped="\\\\";;
$'/' ) escaped="\\/";;
$'\b') escaped="\\b";;
$'\f') escaped="\\f";;
$'\n') escaped="\\n";;
$'\r') escaped="\\r";;
$'\t') escaped="\\t";;
*)
if [[ "${char}" < $'\x20' ]]; then
escaped=$(printf "\u%04X" "'${char}")
fi
;;
$'"' ) escaped="\\\"";;
$'\\') escaped="\\\\";;
*)
if [[ "${char}" < $'\x20' ]]; then
case "${char}" in
$'\b') escaped="\\b";;
$'\f') escaped="\\f";;
$'\n') escaped="\\n";;
$'\r') escaped="\\r";;
$'\t') escaped="\\t";;
*) escaped=$(printf "\u%04X" "'${char}")
esac
fi;;
esac
echo -n "${escaped}"
done
Expand Down
Loading