mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-03-02 02:29:25 +01:00
simplify bookmarks tag filter sql
This commit is contained in:
parent
508e56fa9f
commit
57433ca09e
@ -39,13 +39,9 @@ $params=array(OC_User::getUser());
|
|||||||
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
|
||||||
|
|
||||||
//Filter for tag?
|
//Filter for tag?
|
||||||
$filterTag = isset($_GET["tag"]) ? urldecode($_GET["tag"]) : false;
|
$filterTag = isset($_GET["tag"]) ? '%' . urldecode($_GET["tag"]) . '%' : false;
|
||||||
if($filterTag){
|
if($filterTag){
|
||||||
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
|
$sqlFilterTag = 'HAVING tags LIKE ?';
|
||||||
$sqlFilterTag = "HAVING tags LIKE '%' || ? || '%'";
|
|
||||||
} else {
|
|
||||||
$sqlFilterTag = "HAVING INSTR (tags, ?) > 0";
|
|
||||||
}
|
|
||||||
$params[] = $filterTag;
|
$params[] = $filterTag;
|
||||||
} else {
|
} else {
|
||||||
$sqlFilterTag = '';
|
$sqlFilterTag = '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user