]> git.plutz.net Git - shellwiki/blobdiff - handlers/90_brackets.sh
avoid nonexitent globs in attachment_glob() (i.e. foo-*.bar)
[shellwiki] / handlers / 90_brackets.sh
index dadd6445f663c80abb3a03d3ed9e6bd5c570d121..ce49b0e9a36fd9456d74d99950da40609f5d5a1d 100755 (executable)
@@ -6,8 +6,12 @@
 # attachment and edit (and really all) handlers should take precedence
 
 case "${PATH_INFO}" in
+  */\[view\])
+    # explicit view handler for linking
+    REDIRECT "${_BASE}${PATH_INFO%\[view\]}"
+    ;;
   */)
-    if [ ! "$(mdfile "${PATH_INFO}")" ]; then
+    if ! mdfile "${PATH_INFO}" >&-; then
       theme_error 404
     elif ! acl_read "${PATH_INFO}"; then
       theme_error 403