fix: legacy QR URLs without '?' (productid in path) redirect to /t/CODE (new tag 97 now scans); preview page photo portrait aspect; Preview button on user tags list; admin photo form = preview + standalone Upload button (removed URL TextInput — no duplicate, no stale placeholder)

This commit is contained in:
2026-08-10 16:54:10 +10:00
parent ae0290b343
commit 04fd5ac63a
4 changed files with 24 additions and 2 deletions

View File

@@ -0,0 +1,21 @@
package handlers
import (
"net/http"
"strings"
)
// LegacyNotFound handles old printed QR URLs of the form
// https://where-woof.com/x=5&productid=CODE (no '?' before productid —
// the whole thing lands in the path). Redirects to /t/CODE.
func (a *App) LegacyNotFound(w http.ResponseWriter, r *http.Request) {
path := r.URL.Path
if i := strings.Index(path, "productid="); i >= 0 {
code := path[i+len("productid="):]
if code != "" {
http.Redirect(w, r, "/t/"+code, http.StatusFound)
return
}
}
http.NotFound(w, r)
}