X-Git-Url: http://git.plutz.net/?p=bookman;a=blobdiff_plain;f=index.cgi;h=e28675cfe31496ac70c03729446f689a892e14a1;hp=911e5eed684715e6e67cf5413617b33752f831d9;hb=ee45a65869f9a77232980c05c2ceb17238149f84;hpb=28ce309347435c1dd23beab8104d36cbe640d2dd diff --git a/index.cgi b/index.cgi index 911e5ee..e28675c 100755 --- a/index.cgi +++ b/index.cgi @@ -92,8 +92,8 @@ QRYID="$(GET id |checkid)" BDB="users/${COKID}" if [ -n "$QRYID" ]; then - printf '%s 303 See Other\r\n' "$SERVER_PROTOCOL" - printf 'Location: %s\r\n' "${SCRIPT_NAME}?${QUERY_STRING#id=*&}" + printf 'Status: 303 See Other\r\n' + printf 'Location: %s\r\n' "${SCRIPT_NAME}?${QUERY_STRING#id=????????????}" SET_COOKIE +8640000 "id=${QRYID}" printf '\r\n' exit 0 @@ -111,7 +111,7 @@ elif [ -z "$COKID" -a -z "$QRYID" ]; then EOF exit 0 elif ! [ -d "${BDB}" ]; then - printf '%s 404 Not Found\r\n' "$SERVER_PROTOCOL" + printf 'Status: 404 Not Found\r\n' printf 'Content-Type: text/html; charset=utf-8\r\n\r\n' cat <<-EOF @@ -132,7 +132,7 @@ case "$(GET action)" in { git init "users/${NEWID}" || mkdir -p "users/${NEWID}"; } >&- - printf '%s 303 See Other\r\n' "$SERVER_PROTOCOL" + printf 'Status: 303 See Other\r\n' printf 'Location: %s\r\n' "${SCRIPT_NAME}?id=${NEWID}" SET_COOKIE +8640000 "id=${NEWID}" printf '\r\n' @@ -174,10 +174,10 @@ case "$(GET action)" in tfile="${BDB}/${target}.bm" if [ "$(POST control)" = confirm -a -f "$file" ]; then if [ "$target" = "____________" ]; then - rm -f "$file" >&- + rm -f "$file" "${file%.bm}.cache" >&- git -C "${BDB}" commit -m "Deleted folder ${fid}" -- "${fid}.bm" >&- elif tail -n+2 "$file" >>"$tfile"; then - rm -f "$file" >&- + rm -f "$file" "${file%.bm}.cache" >&- git -C "${BDB}" commit -m "Deleted folder ${fid}" -- "${fid}.bm" "${target}.bm" >&- fi fi @@ -288,7 +288,6 @@ bookmarkgen(){ url="$(GET nbmurl)" file="${BDB}/${fid}.bm" - [ "$url" = "${url#*://}" ] && url="http://$url" if [ -z "$name" -a -n "$url" ]; then name="$(wget -O- "$url" \ | head -c4096 \ @@ -297,6 +296,7 @@ bookmarkgen(){ fi if [ -n "$fid" -o -n "$name" -o -n "$url" ]; then + [ "$url" = "${url#*://}" ] && url="http://$url" cat <<-EOF

New Bookmark

@@ -496,6 +496,9 @@ cat < + EOF