]> git.plutz.net Git - shellwiki/commitdiff
handle accidental double language links
authorPaul Hänsch <paul@plutz.net>
Sun, 30 Jul 2023 10:15:34 +0000 (12:15 +0200)
committerPaul Hänsch <paul@plutz.net>
Sun, 30 Jul 2023 10:15:34 +0000 (12:15 +0200)
handlers/10_translations.sh

index 4b3464031aced41bae5581ea40728d2caf6a4e31..e93b465e9ce2849d6c0aca8da3210d7178aa7da5 100755 (executable)
@@ -29,6 +29,10 @@ case ${PATH_INFO} in
     ;;
   */:?*/\[*\])
     :;;  # Default handler, considered valid in most cases
+  */:?*/:?*)
+    # Accidental double language link, last one stays valid!
+    REDIRECT "${_BASE}${PATH_INFO%/:?*/:?*}/:${PATH_INFO##*/:}"
+    ;;
   */:?*/?*)
     :;;  # Default attachment handler
   */:?*/)   # Faulty URL build