]> git.plutz.net Git - webpoll/commitdiff
fix url display for poll link (http/https)
authorPaul Hänsch <paul@plutz.net>
Sun, 13 Apr 2025 12:40:35 +0000 (14:40 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 13 Apr 2025 12:40:35 +0000 (14:40 +0200)
index.cgi
newdate.sh

index 060d7dcc0670432a98b0ea97dcb671a64ae8288f..b2b953102326afe23e16b408a74eeae4e327367d 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -6,6 +6,8 @@
 . "$_EXEC"/cgilite/storage.sh
 . "$_EXEC"/widgets.sh
 
+[ -n "$HTTPS" ] && HTTPs=https || HTTPs=http
+
 # PATH_INFO="$(PATH "/${PATH_INFO#${_BASE}}")"
 
 # bookmarks_cookie="$(COOKIE bookmarks |grep -xE '[0-9a-zA-Z:=]{16}(/[0-9a-zA-Z:=]{16})?( [0-9a-zA-Z:=]{16}(/[0-9a-zA-Z:=]{16})?)*')"
index 83e27b64cb8c21cd0022db779463d2fb4363d2ba..fc25ca5a0e97c4503496585a8da59a5fbcd67865 100755 (executable)
@@ -162,11 +162,11 @@ else
          $(if [ "$bookmarks" ]; then
            printf '[section .bookmark This admin page is accessible via the link [a href="%s" . %s]. You must copy this link and keep it safe, so you can modify this poll later! The poll has also been bookmarked and will be listed on the front page.]' \
            "$(URL "//$(HEADER Host)/${_BASE}/${id}/${admin}")" \
-           "$(HTML "${HTTPS:+https:}${HTTPS:-http:}//$(HEADER Host)$(PATH "/${_BASE}/${id}/${admin}")")"
+           "$(HTML "${HTTPs}://$(HEADER Host)$(PATH "/${_BASE}/${id}/${admin}")")"
           else
            printf '[section .bookmark This admin page is accessible via the link [a href="%s" . %s]. You must copy this link and keep it safe, so you can modify this poll later! You can also set a Cookie to bookmark all polls you visit, including this admin page. Bookmarked polls will be listed on the frontpage.<br/> [submit "bookmark" "add" Set Cookie]]' \
            "$(URL "//$(HEADER Host)/${_BASE}/${id}/${admin}")" \
-           "$(HTML "${HTTPS:+https:}${HTTPS:-http:}//$(HEADER Host)$(PATH "/${_BASE}/${id}/${admin}")")"
+           "$(HTML "${HTTPs}://$(HEADER Host)$(PATH "/${_BASE}/${id}/${admin}")")"
          fi)
          [fieldset .date
            $(printf '[hidden "date" "%s"]' $additional)