Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion app/Http/Controllers/SubscribeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class SubscribeController extends Controller
*/
public function showSubscribe()
{
if (!subscribers_enabled()) {
return Redirect::route('status-page');
}
Comment on lines +48 to +50
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subscribe routes are already protected by the subscribers route middleware, which performs the same !subscribers_enabled() redirect (see app/Http/Routes/SubscribeRoutes.php:32 and app/Http/Middleware/SubscribersConfigured.php:28-34). Duplicating the gate here in the controller adds a second source of truth that can drift; consider relying on the middleware (or, if the middleware isn’t reliably applied in some deployments, fix the routing/middleware configuration instead of duplicating the check).

Copilot uses AI. Check for mistakes.
Comment on lines 46 to +50
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

showSubscribe() can now return a redirect when subscribers are disabled, but the PHPDoc still declares @return \\Illuminate\\View\\View. Please update the docblock return type to reflect that this method may return a redirect response as well.

Copilot uses AI. Check for mistakes.

return View::make('subscribe.subscribe')
->withAboutApp(Markdown::convertToHtml(Config::get('setting.app_about')));
}
Expand All @@ -56,8 +60,11 @@ public function showSubscribe()
*/
public function postSubscribe()
{
if (!subscribers_enabled()) {
return Redirect::route('status-page');
}
Comment on lines 61 to +65
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postSubscribe() returns a redirect response in all paths (including the new disabled-subscribers guard), but its PHPDoc declares @return \\Illuminate\\View\\View. Update the docblock return type to match the actual response type(s).

Copilot uses AI. Check for mistakes.

$email = Binput::get('email');
$subscriptions = Binput::get('subscriptions');
$verified = app(Repository::class)->get('setting.skip_subscriber_verification');

try {
Expand Down
Loading