simplify bookmarks tag filter sql

This commit is contained in:
Arthur Schiwon 2011-08-23 11:57:56 +02:00
parent 53f0381f0f
commit 72a4703d82
1 changed files with 2 additions and 6 deletions

View File

@ -39,13 +39,9 @@ $params=array(OC_User::getUser());
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
//Filter for tag?
$filterTag = isset($_GET["tag"]) ? urldecode($_GET["tag"]) : false;
$filterTag = isset($_GET["tag"]) ? '%' . urldecode($_GET["tag"]) . '%' : false;
if($filterTag){
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$sqlFilterTag = "HAVING tags LIKE '%' || ? || '%'";
} else {
$sqlFilterTag = "HAVING INSTR (tags, ?) > 0";
}
$sqlFilterTag = 'HAVING tags LIKE ?';
$params[] = $filterTag;
} else {
$sqlFilterTag = '';