]> git.plutz.net Git - lobster/commitdiff
remove leading slash (/) from link anchor when redirecting
authorPaul Hänsch <paul@plutz.net>
Tue, 7 Jan 2020 14:15:16 +0000 (15:15 +0100)
committerPaul Hänsch <paul@plutz.net>
Tue, 7 Jan 2020 14:15:16 +0000 (15:15 +0100)
cards/edit_card.sh
cards/update_card.sh

index 61c58fe815c10cb456f5f9e3c73c4bd8d52c9c00..a29a098ad76f3fe735c54cc5ab2d54c4e5444e62 100755 (executable)
@@ -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
index 9d56c50e5de4793c1eec16c1d88630534a9cc996..c13b6ec2cbf251e4eda4b5f97363b33e900104ba 100755 (executable)
@@ -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)