X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FFileTag.php;h=ec89c96c696236e35b1689d7fad7275ed1a852c9;hb=6dbbd081795fa1c8fe57db2248ac162efeeada88;hp=0b728e33d7c979b3046dc658dfccbf70a0418c49;hpb=59675c4f0bbb12029e3b7a141ca484fb180a2fef;p=friendica.git diff --git a/src/Model/FileTag.php b/src/Model/FileTag.php index 0b728e33d7..ec89c96c69 100644 --- a/src/Model/FileTag.php +++ b/src/Model/FileTag.php @@ -1,6 +1,6 @@ ', '[', ']'], ['%3c', '%3e', '%5b', '%5d'], $s); } @@ -54,31 +50,11 @@ class FileTag * * @return string The decoded string. */ - public static function decode($s) + private static function decode($s) { return str_replace(['%3c', '%3e', '%5b', '%5d'], ['<', '>', '[', ']'], $s); } - /** - * Query files for tag - * - * @param string $table The table to be queired. - * @param string $s The search term - * @param string $type Optional file type. - * - * @return string Query string. - */ - public static function fileQuery($table, $s, $type = 'file') - { - if ($type == 'file') { - $str = preg_quote('[' . str_replace('%', '%%', self::encode($s)) . ']'); - } else { - $str = preg_quote('<' . str_replace('%', '%%', self::encode($s)) . '>'); - } - - return " AND " . (($table) ? DBA::escape($table) . '.' : '') . "file regexp '" . DBA::escape($str) . "' "; - } - /** * Get file tags from array * @@ -138,186 +114,4 @@ class FileTag return $return; } - - /** - * Get file tags from list - * - * ex. given music,video return