X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=attachment.sh;h=d004b0db549954f00575810169f6a6665c9357e3;hb=e52003a2f0aecacd91af213b8f5b777022d3a104;hp=68e03b9b7ab9435961ca41abbaa93e2667aced7d;hpb=ad80bc2c5d655b67abea18b7b6c107896e7b3150;p=shellwiki diff --git a/attachment.sh b/attachment.sh index 68e03b9..d004b0d 100755 --- a/attachment.sh +++ b/attachment.sh @@ -60,7 +60,17 @@ attachment_convert(){ esac } -if [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then +if [ "${PATH_INFO%/\[attachment\]/}" != "${PATH_INFO}" ]; then + . "$_EXEC/multipart.sh" + if multipart_cache; then + debug 'Multipart "file":' + multipart file |hd |debug >/dev/null + REDIRECT "${_BASE}${PATH_INFO}" + else + theme_attachments "${PATH_INFO%\[attachment\]/}" + fi + +elif [ "${PATH_INFO%/\[attachment\]/*}" != "${PATH_INFO}" ]; then attpath="${PATH_INFO%/\[attachment\]/*}/#attachments/${PATH_INFO##*/}" if [ -f "$_DATA/pages/$attpath" ]; then FILE "$_DATA/pages/$attpath"