]>
BookStack Code Mirror - bookstack/blobdiff - app/Uploads/ImageRepo.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Done a refactor pass on PermissionService
[bookstack]
/
app
/
Uploads
/
ImageRepo.php
diff --git
a/app/Uploads/ImageRepo.php
b/app/Uploads/ImageRepo.php
index b4d743b73447a2cc99dade9b367f78e489020279..e6f7668241dafa4dcfad7a0b852bfc6d214904c8 100644
(file)
--- a/
app/Uploads/ImageRepo.php
+++ b/
app/Uploads/ImageRepo.php
@@
-70,8
+70,7
@@
class ImageRepo
int $uploadedTo = null,
string $search = null,
callable $whereClause = null
int $uploadedTo = null,
string $search = null,
callable $whereClause = null
- ): array
- {
+ ): array {
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
if ($uploadedTo !== null) {
$imageQuery = $this->image->newQuery()->where('type', '=', strtolower($type));
if ($uploadedTo !== null) {
@@
-83,7
+82,7
@@
class ImageRepo
}
// Filter by page access
}
// Filter by page access
- $imageQuery = $this->restrictionService->filterRelatedEntity(
'page'
, $imageQuery, 'images', 'uploaded_to');
+ $imageQuery = $this->restrictionService->filterRelatedEntity(
Page::class
, $imageQuery, 'images', 'uploaded_to');
if ($whereClause !== null) {
$imageQuery = $imageQuery->where($whereClause);
if ($whereClause !== null) {
$imageQuery = $imageQuery->where($whereClause);
@@
-102,8
+101,7
@@
class ImageRepo
int $pageSize = 24,
int $uploadedTo = null,
string $search = null
int $pageSize = 24,
int $uploadedTo = null,
string $search = null
- ): array
- {
+ ): array {
$contextPage = $this->page->findOrFail($uploadedTo);
$parentFilter = null;
$contextPage = $this->page->findOrFail($uploadedTo);
$parentFilter = null;