From 72a4703d82da28fd08ae60a62bbfff253bff998f Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Tue, 23 Aug 2011 11:57:56 +0200 Subject: [PATCH] simplify bookmarks tag filter sql --- apps/bookmarks/ajax/updateList.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index 7be14b9609..1eb40c0fbc 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -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 = '';