From: Paul Hänsch Date: Tue, 7 Jan 2020 14:15:16 +0000 (+0100) Subject: remove leading slash (/) from link anchor when redirecting X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=3dde2397fa3cd53d77f81c3cd6a988138a9b67b4;p=lobster remove leading slash (/) from link anchor when redirecting --- 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)