summaryrefslogtreecommitdiffstats
path: root/apps/bookmarks
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2011-08-23 11:43:27 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2011-08-23 11:43:27 +0200
commit53f0381f0f5dc2187a904fe7c32b94bceda1a53d (patch)
tree917bdb57110b63177b43b21c6cf2e90cc4abfcdd /apps/bookmarks
parent391e064e67eaab5fb63ed568946af97b6a243fdd (diff)
downloadnextcloud-server-53f0381f0f5dc2187a904fe7c32b94bceda1a53d.tar.gz
nextcloud-server-53f0381f0f5dc2187a904fe7c32b94bceda1a53d.zip
make tag filter compatible with sqlite
Diffstat (limited to 'apps/bookmarks')
-rw-r--r--apps/bookmarks/ajax/updateList.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php
index 1217a64c6e1..7be14b9609b 100644
--- a/apps/bookmarks/ajax/updateList.php
+++ b/apps/bookmarks/ajax/updateList.php
@@ -36,11 +36,16 @@ if( !OC_User::isLoggedIn()){
}
$params=array(OC_User::getUser());
+$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
//Filter for tag?
$filterTag = isset($_GET["tag"]) ? urldecode($_GET["tag"]) : false;
if($filterTag){
- $sqlFilterTag = "HAVING INSTR (tags, ?) > 0";
+ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
+ $sqlFilterTag = "HAVING tags LIKE '%' || ? || '%'";
+ } else {
+ $sqlFilterTag = "HAVING INSTR (tags, ?) > 0";
+ }
$params[] = $filterTag;
} else {
$sqlFilterTag = '';
@@ -49,7 +54,6 @@ if($filterTag){
$offset = isset($_GET["page"]) ? intval($_GET["page"]) * 10 : 0;
$params[] = $offset;
-$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$_gc_separator = ", ' '";
} else {