diff options
author | friendica <info@friendica.com> | 2012-07-10 06:28:02 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-07-10 06:28:02 -0700 |
commit | 94fabe3a2942ca93b436694f180f8eb2a72df918 (patch) | |
tree | 37333905f9d0b0c3a3d0fdf4366d4720cee9e680 /include/text.php | |
parent | 1215de575d9cda66b434f21dafdf44f986638b71 (diff) | |
download | volse-hubzilla-94fabe3a2942ca93b436694f180f8eb2a72df918.tar.gz volse-hubzilla-94fabe3a2942ca93b436694f180f8eb2a72df918.tar.bz2 volse-hubzilla-94fabe3a2942ca93b436694f180f8eb2a72df918.zip |
upstream fixes and a lot of taxonomy stuff
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/text.php b/include/text.php index f3bc94265..59ef5a88f 100644 --- a/include/text.php +++ b/include/text.php @@ -1328,10 +1328,14 @@ function file_tag_decode($s) { function file_tag_file_query($table,$s,$type = 'file') { if($type == 'file') - $str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' ); + $termtype = TERM_FILE; else - $str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' ); - return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' "; + $termtype = TERM_CATEGORY; + + return sprintf(" AND " . (($table) ? dbesc($table) . '.' : '') . "id in (select term.oid from term where term.type = %d and term.term = '%s' and term.uid = " . (($table) ? dbesc($table) . '.' : '') . "uid ) ", + intval($termtype), + protect_sprintf(dbesc($s)) + ); } // ex. given music,video return <music><video> or [music][video] |