]> git.plutz.net Git - serve0/commitdiff
allow additional characters in tags
authorpaul <paul@plutz.net>
Wed, 24 Feb 2016 12:50:13 +0000 (12:50 +0000)
committerpaul <paul@plutz.net>
Wed, 24 Feb 2016 12:50:13 +0000 (12:50 +0000)
svn path=/trunk/; revision=102

actions/filter.sh
actions/meta.sh
actions/multitag.sh
pages/list.sh

index 6f64a97698e5b5d02299a115ca935d120366b177..718d7e866760a2d62cbc8cf35f009a1124277fa5 100755 (executable)
@@ -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}^"
index 894743e7796f558fcc6fb05a77c16155a189c881..d44e0471d98a3098e08195d099a7fbea8d3ea2f3 100755 (executable)
@@ -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
index 5691b4fd8869c3dfe254ad2a53d956ecba64cb8c..242db282559fdb5d8c9c6a69d4e1d40eabc4487e 100755 (executable)
@@ -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
index deb8ce8518316311e29378f6512d3598f4496082..9f2b9eeb761c26c4f4bf66394d72eb895311783c 100755 (executable)
@@ -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}}"