diff --git a/apps/dav/lib/Paginate/PaginateCache.php b/apps/dav/lib/Paginate/PaginateCache.php index 0e5abca287329..29ea7aa78a86c 100644 --- a/apps/dav/lib/Paginate/PaginateCache.php +++ b/apps/dav/lib/Paginate/PaginateCache.php @@ -27,7 +27,7 @@ public function __construct( /** * @param string $uri * @param \Iterator $items - * @return array{'token': int, 'count': int} + * @return array{'token': string, 'count': int} */ public function store(string $uri, \Iterator $items): array { $token = $this->random->generate(32); @@ -45,7 +45,7 @@ public function store(string $uri, \Iterator $items): array { $count = 0; foreach ($items as $item) { - $value = json_encode($item); + $value = serialize($item); $query->setParameter('index', $count, IQueryBuilder::PARAM_INT); $query->setParameter('value', $value); $query->executeStatement(); @@ -72,8 +72,10 @@ public function get(string $url, string $token, int $offset, int $count) { ->andWhere($query->expr()->lt('result_index', $query->createNamedParameter($offset + $count, IQueryBuilder::PARAM_INT))); $result = $query->executeQuery(); + ini_set('html_errors', 0); return array_map(function (string $entry) { - return json_decode($entry, true); + var_dump($entry, unserialize($entry)); + return unserialize($entry); }, $result->fetchAll(\PDO::FETCH_COLUMN)); } diff --git a/apps/dav/lib/Paginate/PaginatePlugin.php b/apps/dav/lib/Paginate/PaginatePlugin.php index 3531dff79b979..c10a97053f7a7 100644 --- a/apps/dav/lib/Paginate/PaginatePlugin.php +++ b/apps/dav/lib/Paginate/PaginatePlugin.php @@ -15,11 +15,11 @@ use Sabre\HTTP\ResponseInterface; class PaginatePlugin extends ServerPlugin { - public const PAGINATE_HEADER = 'x-nc-paginate'; - public const PAGINATE_TOTAL_HEADER = 'x-nc-paginate-total'; - public const PAGINATE_TOKEN_HEADER = 'x-nc-paginate-token'; - public const PAGINATE_OFFSET_HEADER = 'x-nc-paginate-offset'; - public const PAGINATE_COUNT_HEADER = 'x-nc-paginate-count'; + public const PAGINATE_HEADER = 'X-NC-Paginate'; + public const PAGINATE_TOTAL_HEADER = 'X-NC-Paginate-Total'; + public const PAGINATE_TOKEN_HEADER = 'X-NC-Paginate-Token'; + public const PAGINATE_OFFSET_HEADER = 'X-NC-Paginate-Offset'; + public const PAGINATE_COUNT_HEADER = 'X-NC-Paginate-Count'; /** @var Server */ private $server; @@ -86,6 +86,7 @@ public function onMethod(RequestInterface $request, ResponseInterface $response) $data = $this->server->generateMultiStatus($items, $minimal); $response->setBody($data); + return false; } }