Skip to content
Snippets Groups Projects
Commit 49293156 authored by Brice Maron's avatar Brice Maron
Browse files

Fix bookmark listing with mysql: limit is binded as string.

parent 4d1776fa
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,6 @@ if($filterTag){ ...@@ -46,7 +46,6 @@ if($filterTag){
} }
$offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0; $offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0;
$params[] = $offset;
$sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent'; $sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent';
if($sort == 'bookmarks_sorting_clicks') { if($sort == 'bookmarks_sorting_clicks') {
...@@ -62,6 +61,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ ...@@ -62,6 +61,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
} }
if($CONFIG_DBTYPE == 'pgsql' ){ if($CONFIG_DBTYPE == 'pgsql' ){
$params[] = $offset;
$query = OC_DB::prepare(' $query = OC_DB::prepare('
SELECT id, url, title, array_to_string(array_agg(tag), \' \') as tags SELECT id, url, title, array_to_string(array_agg(tag), \' \') as tags
FROM *PREFIX*bookmarks FROM *PREFIX*bookmarks
...@@ -92,7 +92,7 @@ if($CONFIG_DBTYPE == 'pgsql' ){ ...@@ -92,7 +92,7 @@ if($CONFIG_DBTYPE == 'pgsql' ){
GROUP BY url GROUP BY url
'.$sqlFilterTag.' '.$sqlFilterTag.'
ORDER BY *PREFIX*bookmarks.'.$sqlSort.' ORDER BY *PREFIX*bookmarks.'.$sqlSort.'
LIMIT ?, 10'); LIMIT '.$offset.', 10');
} }
$bookmarks = $query->execute($params)->fetchAll(); $bookmarks = $query->execute($params)->fetchAll();
......
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