Skip to content
Snippets Groups Projects
Commit 53f0381f authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

make tag filter compatible with sqlite

parent 391e064e
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment