Merge pull request #19041 from owncloud/issue-19007-parameter-name

Fix parameter name to match the specs
This commit is contained in:
Thomas Müller 2015-09-15 14:15:46 +02:00
commit 474f13c9d6
2 changed files with 10 additions and 10 deletions

View File

@ -292,7 +292,7 @@ class Sharees {
$search = isset($_GET['search']) ? (string) $_GET['search'] : '';
$itemType = isset($_GET['itemType']) ? (string) $_GET['itemType'] : null;
$page = !empty($_GET['page']) ? max(1, (int) $_GET['page']) : 1;
$perPage = !empty($_GET['limit']) ? max(1, (int) $_GET['limit']) : 200;
$perPage = !empty($_GET['perPage']) ? max(1, (int) $_GET['perPage']) : 200;
$shareTypes = [
Share::SHARE_TYPE_USER,
@ -374,7 +374,7 @@ class Sharees {
'search' => $search,
'itemType' => $itemType,
'shareType' => $shareTypes,
'limit' => $perPage,
'perPage' => $perPage,
]));
}

View File

@ -668,21 +668,21 @@ class ShareesTest extends TestCase {
'page' => 10,
], '', true, '', null, $allTypes, 10, 200, false],
// Test limit
// Test perPage
[[
'limit' => 0,
'perPage' => 0,
], '', true, '', null, $allTypes, 1, 200, false],
[[
'limit' => '0',
'perPage' => '0',
], '', true, '', null, $allTypes, 1, 200, false],
[[
'limit' => -1,
'perPage' => -1,
], '', true, '', null, $allTypes, 1, 1, false],
[[
'limit' => 1,
'perPage' => 1,
], '', true, '', null, $allTypes, 1, 1, false],
[[
'limit' => 10,
'perPage' => 10,
], '', true, '', null, $allTypes, 1, 10, false],
// Test $shareWithGroupOnly setting
@ -951,8 +951,8 @@ class ShareesTest extends TestCase {
public function dataGetPaginationLink() {
return [
[1, '/ocs/v1.php', ['limit' => 2], '<?limit=2&page=2>; rel="next"'],
[10, '/ocs/v2.php', ['limit' => 2], '<?limit=2&page=11>; rel="next"'],
[1, '/ocs/v1.php', ['perPage' => 2], '<?perPage=2&page=2>; rel="next"'],
[10, '/ocs/v2.php', ['perPage' => 2], '<?perPage=2&page=11>; rel="next"'],
];
}