From 3dde2397fa3cd53d77f81c3cd6a988138a9b67b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Tue, 7 Jan 2020 15:15:16 +0100 Subject: [PATCH] remove leading slash (/) from link anchor when redirecting --- cards/edit_card.sh | 6 +++--- cards/update_card.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cards/edit_card.sh b/cards/edit_card.sh index 61c58fe..a29a098 100755 --- a/cards/edit_card.sh +++ b/cards/edit_card.sh @@ -26,11 +26,11 @@ filter="$(REF f)" order="$(REF o)" if tempfile="$(SLOCK "$cardfile" "$locktimeout")"; then - REDIRECT "/cards/?o=${order}&f=${filter}&e=${card}" + REDIRECT "/cards/?o=${order}&f=${filter}&e=${card#/}" elif [ -f "$tempfile" ]; then SET_COOKIE session message="SESSLOCK" - REDIRECT "/cards/?o=${order}&f=${filter}#${card}" + REDIRECT "/cards/?o=${order}&f=${filter}#${card#/}" else SET_COOKIE session message="EDITLOCK" - REDIRECT "/cards/?o=${order}&f=${filter}#${card}" + REDIRECT "/cards/?o=${order}&f=${filter}#${card#/}" fi diff --git a/cards/update_card.sh b/cards/update_card.sh index 9d56c50..c13b6ec 100755 --- a/cards/update_card.sh +++ b/cards/update_card.sh @@ -112,7 +112,7 @@ printf '%s' "$vcf" |grep -vx '' >"$tempfile" case "$action" in addfield) - REDIRECT "/cards/?o=${order}&f=${filter}&e=${card}" + REDIRECT "/cards/?o=${order}&f=${filter}&e=${card#/}" ;; update) # attendance=() @@ -132,12 +132,12 @@ case "$action" in cp "$tempfile" "$cardfile" RELEASE_SLOCK "$cardfile" - REDIRECT "/cards/?o=${order}&f=${filter}#${card}" + REDIRECT "/cards/?o=${order}&f=${filter}#${card#/}" ;; cancel) RELEASE_SLOCK "$cardfile" [ -f "$cardfile" ] \ - && REDIRECT "/cards/?o=${order}&f=${filter}#${card}" \ + && REDIRECT "/cards/?o=${order}&f=${filter}#${card#/}" \ || REDIRECT "/cards/?o=${order}&f=${filter}" ;; delete) -- 2.39.2