X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=macros%2Fgallery;h=edc6a39d1f2240198fb924f728c2940eb9138c82;hb=fb51b18918aa9f6d6f93576b9c7fbf3ea4c12ef3;hp=306c517352237b784d3904467bb047a6cf2c7bdc;hpb=1addbd404bc8cd6f869e9e1df19cc83081fa7bc2;p=shellwiki diff --git a/macros/gallery b/macros/gallery index 306c517..edc6a39 100755 --- a/macros/gallery +++ b/macros/gallery @@ -1,5 +1,19 @@ #!/bin/sh +# Copyright 2023 Paul Hänsch +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +# IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + . "$_EXEC/cgilite/cgilite.sh" . "$_EXEC/acl.sh" . "$_EXEC/tools.sh" @@ -16,16 +30,17 @@ for glob in "$@"; do && attachment_glob "$glob" done \ | grep -xiE '.*\.jpe?g|.*\.png|.*\.gif' \ -| sort -u \ | while read attachment; do case $attachment in */*) - printf '' \ - "${attachment%/*}/[attachment]/${attachment##*/}" "${attachment}" + printf '' \ + "$(URL "${attachment%/*}/[attachment]/${attachment##*/}")" \ + "$(URL "${attachment}")" ;; *) - printf '' \ - "[attachment]/${attachment}" "${attachment}" + printf '' \ + "$(URL "[attachment]/${attachment}")" \ + "$(URL "${attachment}")" ;; esac done