diff --git a/CHANGELOG.md b/CHANGELOG.md
index 75c857a4..99bbcb86 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,11 @@
- Updated NotificationCard.vue component, add follow requests at top of card, remove card-header ([5e48ffca](https://github.com/pixelfed/pixelfed/commit/5e48ffca))
- Updated RemoteProfile.vue component, add warning for empty profiles and last_fetched_at ([66f44a9d](https://github.com/pixelfed/pixelfed/commit/66f44a9d))
- Updated ApiV1Controller, enforce public timeline setting ([285bd485](https://github.com/pixelfed/pixelfed/commit/285bd485))
-- Update SearchController, fix self search bug and rank local matches higher ([f67fada2](https://github.com/pixelfed/pixelfed/commit/f67fada2))
+- Updated SearchController, fix self search bug and rank local matches higher ([f67fada2](https://github.com/pixelfed/pixelfed/commit/f67fada2))
+- Updated FederationController, improve webfinger logic, fixes ([#2180](https://github.com/pixelfed/pixelfed/issues/2180)) ([302ff874](https://github.com/pixelfed/pixelfed/commit/302ff874))
+- Updated ApiV1Controller, fix broken auth check on public timelines. Fixes ([#2168](https://github.com/pixelfed/pixelfed/issues/2168)) ([aa49afc7](https://github.com/pixelfed/pixelfed/commit/aa49afc7))
+- Updated SearchApiV2Service, fix offset bug ([#2116](https://github.com/pixelfed/pixelfed/issues/2116)) ([a0c0c84d](https://github.com/pixelfed/pixelfed/commit/a0c0c84d))
+- Updated api routes, fixes ([#2114](https://github.com/pixelfed/pixelfed/issues/2114)) ([50bbeddd](https://github.com/pixelfed/pixelfed/commit/50bbeddd))
## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9)
diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php
index 83cc2af0..1a9e4220 100644
--- a/app/Http/Controllers/Api/ApiV1Controller.php
+++ b/app/Http/Controllers/Api/ApiV1Controller.php
@@ -1397,8 +1397,6 @@ class ApiV1Controller extends Controller
*/
public function timelinePublic(Request $request)
{
- abort_if(!config('instance.timeline.local.is_public') && !$request->user(), 403);
-
$this->validate($request,[
'page' => 'nullable|integer|max:40',
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
diff --git a/app/Http/Controllers/DiscoverController.php b/app/Http/Controllers/DiscoverController.php
index fd90d228..4f443ed2 100644
--- a/app/Http/Controllers/DiscoverController.php
+++ b/app/Http/Controllers/DiscoverController.php
@@ -135,6 +135,7 @@ class DiscoverController extends Controller
public function profilesDirectory(Request $request)
{
+ return redirect('/')->with('statusRedirect', 'The Profile Directory is unavailable at this time.');
return view('discover.profiles.home');
}
@@ -144,6 +145,8 @@ class DiscoverController extends Controller
'page' => 'integer|max:10'
]);
+ return ['error' => 'Temporarily unavailable.'];
+
$page = $request->input('page') ?? 1;
$key = 'discover:profiles:page:' . $page;
$ttl = now()->addHours(12);
diff --git a/app/Http/Controllers/FederationController.php b/app/Http/Controllers/FederationController.php
index 8b7292c0..182725ad 100644
--- a/app/Http/Controllers/FederationController.php
+++ b/app/Http/Controllers/FederationController.php
@@ -46,14 +46,14 @@ class FederationController extends Controller
public function webfinger(Request $request)
{
- abort_if(!config('federation.webfinger.enabled'), 404);
+ abort_if(!config('federation.webfinger.enabled'), 400);
- $this->validate($request, ['resource'=>'required|string|min:3|max:255']);
+ abort_if(!$request->filled('resource'), 400);
$resource = $request->input('resource');
$parsed = Nickname::normalizeProfileUrl($resource);
if($parsed['domain'] !== config('pixelfed.domain.app')) {
- abort(404);
+ abort(400);
}
$username = $parsed['username'];
$profile = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();
@@ -108,7 +108,7 @@ class FederationController extends Controller
return ProfileController::accountCheck($profile);
}
$body = $request->getContent();
- $bodyDecoded = json_decode($body, true, 8);
+ $bodyDecoded = json_decode($body, true, 12);
if($this->verifySignature($request, $profile) == true) {
InboxWorker::dispatch($request->headers->all(), $profile, $bodyDecoded);
} else if($this->blindKeyRotation($request, $profile) == true) {
diff --git a/app/Services/SearchApiV2Service.php b/app/Services/SearchApiV2Service.php
index 940812d7..7fc7c626 100644
--- a/app/Services/SearchApiV2Service.php
+++ b/app/Services/SearchApiV2Service.php
@@ -86,13 +86,12 @@ class SearchApiV2Service
protected function accounts()
{
- $limit = $this->query->input('limit', 20);
+ $limit = $this->query->input('limit') ?? 20;
+ $offset = $this->query->input('offset') ?? 0;
$query = '%' . $this->query->input('q') . '%';
$results = Profile::whereNull('status')
->where('username', 'like', $query)
- ->when($this->query->input('offset') != null, function($q, $offset) {
- return $q->offset($offset);
- })
+ ->offset($offset)
->limit($limit)
->get();
@@ -104,13 +103,12 @@ class SearchApiV2Service
protected function hashtags()
{
- $limit = $this->query->input('limit', 20);
+ $limit = $this->query->input('limit') ?? 20;
+ $offset = $this->query->input('offset') ?? 0;
$query = '%' . $this->query->input('q') . '%';
return Hashtag::whereIsBanned(false)
->where('name', 'like', $query)
- ->when($this->query->input('offset') != null, function($q, $offset) {
- return $q->offset($offset);
- })
+ ->offset($offset)
->limit($limit)
->get()
->map(function($tag) {
@@ -124,21 +122,8 @@ class SearchApiV2Service
protected function statuses()
{
- $limit = $this->query->input('limit', 20);
- $query = '%' . $this->query->input('q') . '%';
- $results = Status::where('caption', 'like', $query)
- ->whereScope('public')
- ->when($this->query->input('offset') != null, function($q, $offset) {
- return $q->offset($offset);
- })
- ->limit($limit)
- ->orderByDesc('created_at')
- ->get();
-
- $fractal = new Fractal\Manager();
- $fractal->setSerializer(new ArraySerializer());
- $resource = new Fractal\Resource\Collection($results, new StatusTransformer());
- return $fractal->createData($resource)->toArray();
+ // Removed until we provide more relevent sorting/results
+ return [];
}
protected function statusesById()
@@ -148,9 +133,6 @@ class SearchApiV2Service
$query = '%' . $this->query->input('q') . '%';
$results = Status::where('caption', 'like', $query)
->whereProfileId($accountId)
- ->when($this->query->input('offset') != null, function($q, $offset) {
- return $q->offset($offset);
- })
->limit($limit)
->get();
diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php
index 4b8f9392..10b54841 100644
--- a/app/Util/ActivityPub/Inbox.php
+++ b/app/Util/ActivityPub/Inbox.php
@@ -18,10 +18,11 @@ use App\Util\ActivityPub\Helpers;
use App\Jobs\LikePipeline\LikePipeline;
use App\Jobs\FollowPipeline\FollowPipeline;
-use App\Util\ActivityPub\Validator\{
- Accept,
- Follow
-};
+use App\Util\ActivityPub\Validator\Accept as AcceptValidator;
+use App\Util\ActivityPub\Validator\Announce as AnnounceValidator;
+use App\Util\ActivityPub\Validator\Follow as FollowValidator;
+use App\Util\ActivityPub\Validator\Like as LikeValidator;
+use App\Util\ActivityPub\Validator\UndoFollow as UndoFollowValidator;
class Inbox
{
@@ -41,9 +42,15 @@ class Inbox
{
$this->handleVerb();
- (new Activity())->create([
- 'data' => json_encode($this->payload)
- ]);
+ if(!Activity::where('data->id', $this->payload['id'])->exists()){
+ (new Activity())->create([
+ 'to_id' => $this->profile->id,
+ 'data' => json_encode($this->payload)
+ ]);
+ }
+
+ return;
+
}
public function handleVerb()
@@ -59,11 +66,12 @@ class Inbox
break;
case 'Announce':
+ if(AnnounceValidator::validate($this->payload) == false) { return; }
$this->handleAnnounceActivity();
break;
case 'Accept':
- if(Accept::validate($this->payload) == false) { return; }
+ if(AcceptValidator::validate($this->payload) == false) { return; }
$this->handleAcceptActivity();
break;
diff --git a/app/Util/ActivityPub/Validator/Announce.php b/app/Util/ActivityPub/Validator/Announce.php
index c66fedbb..b6f89eec 100644
--- a/app/Util/ActivityPub/Validator/Announce.php
+++ b/app/Util/ActivityPub/Validator/Announce.php
@@ -16,11 +16,11 @@ class Announce {
'required',
Rule::in(['Announce'])
],
- 'actor' => 'required|url|active_url',
+ 'actor' => 'required|url',
'published' => 'required|date',
'to' => 'required',
'cc' => 'required',
- 'object' => 'required|url|active_url'
+ 'object' => 'required|url'
])->passes();
return $valid;
diff --git a/app/Util/ActivityPub/Validator/Follow.php b/app/Util/ActivityPub/Validator/Follow.php
index a9c6ca2e..b249f7a3 100644
--- a/app/Util/ActivityPub/Validator/Follow.php
+++ b/app/Util/ActivityPub/Validator/Follow.php
@@ -16,8 +16,8 @@ class Follow {
'required',
Rule::in(['Follow'])
],
- 'actor' => 'required|url|active_url',
- 'object' => 'required|url|active_url'
+ 'actor' => 'required|url',
+ 'object' => 'required|url'
])->passes();
return $valid;
diff --git a/app/Util/ActivityPub/Validator/Like.php b/app/Util/ActivityPub/Validator/Like.php
index 2573c1af..6fbdc2b7 100644
--- a/app/Util/ActivityPub/Validator/Like.php
+++ b/app/Util/ActivityPub/Validator/Like.php
@@ -16,8 +16,8 @@ class Like {
'required',
Rule::in(['Like'])
],
- 'actor' => 'required|url|active_url',
- 'object' => 'required|url|active_url'
+ 'actor' => 'required|url',
+ 'object' => 'required|url'
])->passes();
return $valid;
diff --git a/package-lock.json b/package-lock.json
index b4f69768..c844d510 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5088,9 +5088,9 @@
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
},
"jquery": {
- "version": "3.4.1",
- "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.4.1.tgz",
- "integrity": "sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw=="
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.0.tgz",
+ "integrity": "sha512-Xb7SVYMvygPxbFMpTFQiHh1J7HClEaThguL15N/Gg37Lri/qKyhRGZYzHRyLH8Stq3Aow0LsHO2O2ci86fCrNQ=="
},
"js-base64": {
"version": "2.5.2",
diff --git a/package.json b/package.json
index e9a07bfe..ca7cfa12 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"axios": "^0.18.1",
"bootstrap": "^4.4.1",
"cross-env": "^5.2.1",
- "jquery": "^3.4.1",
+ "jquery": "^3.5.0",
"lodash": ">=4.17.13",
"popper.js": "^1.16.1",
"resolve-url-loader": "^2.3.2",
diff --git a/resources/lang/fr/exception.php b/resources/lang/fr/exception.php
new file mode 100644
index 00000000..bd0fedb0
--- /dev/null
+++ b/resources/lang/fr/exception.php
@@ -0,0 +1,10 @@
+ [
+ 'invalid' => [
+ 'album' => 'Doit contenir une seule photo ou vidéo ou plusieurs photos.',
+ ],
+ ],
+
+];
diff --git a/resources/lang/fr/navmenu.php b/resources/lang/fr/navmenu.php
index cae51c6e..34547d54 100644
--- a/resources/lang/fr/navmenu.php
+++ b/resources/lang/fr/navmenu.php
@@ -14,4 +14,5 @@ return [
'admin' => 'Admin',
'logout' => 'Se déconnecter',
'directMessages' => 'Messages Directs',
+ 'composePost' => 'Composer une publication',
];
diff --git a/resources/views/timeline/home.blade.php b/resources/views/timeline/home.blade.php
index f16cab7a..c95e7f6c 100644
--- a/resources/views/timeline/home.blade.php
+++ b/resources/views/timeline/home.blade.php
@@ -1,15 +1,41 @@
@extends('layouts.app')
+{{-- @extends('layouts.blank') --}}
@section('content')
-
-
+ {{ session('statusRedirect') }} +
++ +
+