From 235877da7d36cb076fcbfed285b54ce967907642 Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 24 Feb 2016 12:50:13 +0000 Subject: [PATCH] allow additional characters in tags svn path=/trunk/; revision=102 --- actions/filter.sh | 3 ++- actions/meta.sh | 2 +- actions/multitag.sh | 2 +- pages/list.sh | 4 +++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/actions/filter.sh b/actions/filter.sh index 6f64a97..718d7e8 100755 --- a/actions/filter.sh +++ b/actions/filter.sh @@ -23,7 +23,8 @@ for fn in {0..9}; do category="$(validate "${_POST[category$fn]}" '[[:alnum:]_-]+' none)" n=''; while [ -n "${_POST[cfilter${fn}_$n]}" ]; do - cfilter="$(validate "${_POST[cfilter${fn}_$n]}" '[[:alnum:]\?!\._=\(\)+-]+' '#')" + #cfilter="$(validate "${_POST[cfilter${fn}_$n]}" '[[:alnum:]\?!\._=\(\)+-]+' '#')" + cfilter="${_POST[cfilter${fn}_$n]}" if [ -z "$n" ]; then [ -n "$filters" ] && filters="${filters}^" diff --git a/actions/meta.sh b/actions/meta.sh index 894743e..d44e047 100755 --- a/actions/meta.sh +++ b/actions/meta.sh @@ -32,7 +32,7 @@ height="${_POST[height]}" trash="${_POST[trash]}" cancel="${_POST[cancel]}" tagacc="${_POST[tag]}" -tags="$(htmlsafe "${_POST[tags]}" |sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;' |tr '\n' '|')" +tags="$(htmlsafe "${_POST[tags]}" |sed -r 's:\t: :g;s:^!|[\r\$\^\|]::g;' |tr '\n' '|')" description="$(htmlsafe "${_POST[description]}")" n=0; while [ -n "${_POST[tag$n]}" ]; do diff --git a/actions/multitag.sh b/actions/multitag.sh index 5691b4f..242db28 100755 --- a/actions/multitag.sh +++ b/actions/multitag.sh @@ -53,7 +53,7 @@ while [ -n "${_POST[tagsel$n]}" ]; do done htmlsafe "${_POST[tags]}" printf \\n - ) |sed -r 's:\t| :_:g;s:^!|\r|\$|\^::g;' \ + ) | sed -r 's:\t: :g;s:^!|[\r\$\^\|]::g;' \ | while read tag; do addtag "${_DATA}/meta/$tagsel.meta" "$tag" done diff --git a/pages/list.sh b/pages/list.sh index deb8ce8..9f2b9ee 100755 --- a/pages/list.sh +++ b/pages/list.sh @@ -110,12 +110,14 @@ genlist(){ } thumblist() { - cache="${_DATA}/cache/${pagesize}?o=${order}&s=${search}&f=${filter}&pn=${page}" + cachebase="${pagesize}?o=${order}&s=${search//\//}&f=${filter//\//}&pn=${page}" + cache="${_DATA}/cache/${cachebase}" if [ "$cache" -nt ${_DATA}/videos -a "$cache" -nt ${_DATA}/meta ]; then cat "$cache" else filterex="s;^([0-9]+\t){3}(.+)\n.*$;\2;p" printf '%s\n' "$filter" |tr '^' '\n' \ + | sed -r 's;[]\/\(\)\\\^\$\|\?\.\+\*\;\[\{\}];\\\\&;g' \ | while read each; do [ "${each:0:1}" = '!' ] && filterex="/^[^\n]+\n(.*\|)?(${each#?})(\|.*)?$/d;{${filterex}}" \ || filterex="/^[^\n]+\n(.*\|)?(${each})(\|.*)?$/{${filterex}}" -- 2.39.2