Skip to content

Commit

Permalink
fix: routing exclusion cause errors
Browse files Browse the repository at this point in the history
  • Loading branch information
SychO9 committed May 26, 2023
1 parent 3e9201a commit c86dba4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/src/forum/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ app.initializers.add('sycho/flarum-private-facade', () => {
app.forum.attribute<boolean>('sycho-private-facade.force_redirect') &&
!app.forum.attribute<Array<string>>('sycho-private-facade.route_exclusions').includes(this.routeName)
) {
return m.route.SKIP;
return m.route.set(app.route('sycho-private-facade.login'));
}

return orig(args, requestedPath, route);
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Controller/UploadIllustrationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ protected function makeImage(UploadedFileInterface $file): Image
{
$manager = resolve(ImageManager::class);

return $manager->make($file->getStream())->encode('png');
return $manager->make($file->getStream()->getMetadata('uri'))->encode('png');
}
}
2 changes: 1 addition & 1 deletion src/PrivateFacadeMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public static function getFrontendRouteExclusions(?string $userExcludedRoutes):
protected static function getRouteExclusions(?string $userExcludedRoutes, array $extensionExcludedRoutes): array
{
if (! empty($userExcludedRoutes)) {
$extensionExcludedRoutes = array_merge($extensionExcludedRoutes, explode(', ', $userExcludedRoutes));
$extensionExcludedRoutes = array_merge($extensionExcludedRoutes, explode(',', str_replace(' ', '', $userExcludedRoutes)));
}

return $extensionExcludedRoutes;
Expand Down

0 comments on commit c86dba4

Please sign in to comment.