Mercurial > hgrepos > hgweb.cgi > s4
changeset 339:47d83939666b
Add extension to icon cache file if it has no one
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 23 Oct 2016 23:31:46 +0859 |
parents | 291a3eeed05e |
children | a06cd57df83a |
files | s4-funcs.sh |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/s4-funcs.sh Sun Oct 23 23:11:56 2016 +0859 +++ b/s4-funcs.sh Sun Oct 23 23:31:46 2016 +0859 @@ -1535,6 +1535,12 @@ valtype=`query "$sql0"` filename=${valtype%%//*} filetype=${valtype##*//file:} + if [ x"$filename" = x"${filename%.*}" ]; then + # If nor filename extension found, set it to image type + case "$filetype" in + image/*) filename=$filename.${filetype#image/} ;; + esac + fi cacheimg_S=$dir/S_$filename cacheimg_M=$dir/M_$filename cacheimg_O=$dir/$filename @@ -1575,11 +1581,6 @@ VALUES($pval, '$iconcachekey', 'string', `sqlquote "$cacheimg_S"`); EOF ) -imgsrc_cache_clear() { - # $1=table - # $2=keycond - query "DELETE FROM $1 WHERE $2 AND key='$iconcachekey';" -} showhome() { # $1=userRowIdToShow