From 1d7ef04ca3d154fa665353078c40725f6017650e Mon Sep 17 00:00:00 2001 From: ilestis Date: Fri, 8 Dec 2023 12:04:44 -0600 Subject: [PATCH 1/2] Maps: validate min/max zooms in PHP --- app/Http/Requests/StoreMap.php | 4 ++++ resources/views/maps/form/_settings.blade.php | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Http/Requests/StoreMap.php b/app/Http/Requests/StoreMap.php index 9eecf0314d..f7d8c0ea52 100644 --- a/app/Http/Requests/StoreMap.php +++ b/app/Http/Requests/StoreMap.php @@ -3,6 +3,7 @@ namespace App\Http\Requests; use App\Facades\Limit; +use App\Models\Map; use App\Traits\ApiRequest; use Illuminate\Foundation\Http\FormRequest; @@ -38,6 +39,9 @@ public function rules() 'template_id' => 'nullable', 'center_x' => 'nullable|numeric', 'center_y' => 'nullable|numeric', + 'max_zoom' => 'nullable|numeric|min:1|max:' . Map::MAX_ZOOM, + 'min_zoom' => 'nullable|numeric|min:' . Map::MIN_ZOOM . '|max:' . Map::MAX_ZOOM_REAL, + 'initial_zoom' => 'nullable|numeric|min:' . MAP::MIN_ZOOM . '|max:' . Map::MAX_ZOOM_REAL, ]; $self = request()->route('map'); diff --git a/resources/views/maps/form/_settings.blade.php b/resources/views/maps/form/_settings.blade.php index 219581dd2c..62b014bd04 100644 --- a/resources/views/maps/form/_settings.blade.php +++ b/resources/views/maps/form/_settings.blade.php @@ -47,8 +47,6 @@ [ 'placeholder' => 5, 'class' => '', - 'min' => 1, - 'max' => Map::MAX_ZOOM, ] ) !!} @@ -64,8 +62,6 @@ [ 'placeholder' => -2, 'class' => '', - 'min' => Map::MIN_ZOOM, - 'max' => Map::MAX_ZOOM_REAL, ] ) !!} @@ -81,8 +77,6 @@ [ 'placeholder' => 5, 'class' => '', - 'min' => $minInitial, - 'max' => $maxInitial, ] ) !!} From f7cc643f294cadbb12b6470140bb57a9b3fec72d Mon Sep 17 00:00:00 2001 From: ilestis Date: Sun, 10 Dec 2023 12:00:18 -0600 Subject: [PATCH 2/2] Disable promo --- .../Controllers/Settings/SubscriptionController.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/Http/Controllers/Settings/SubscriptionController.php b/app/Http/Controllers/Settings/SubscriptionController.php index 6710bdbaa4..c612224bdb 100644 --- a/app/Http/Controllers/Settings/SubscriptionController.php +++ b/app/Http/Controllers/Settings/SubscriptionController.php @@ -20,6 +20,7 @@ class SubscriptionController extends Controller { protected SubscriptionService $subscription; + protected SubscriptionUpgradeService $subscriptionUpgrade; /** @@ -32,9 +33,6 @@ public function __construct(SubscriptionService $service, SubscriptionUpgradeSer $this->subscriptionUpgrade = $subscriptionUpgradeService; } - /** - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - */ public function index() { /** @var User $user */ @@ -71,12 +69,6 @@ public function index() )); } - /** - * Change subscription modal - * - * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View - * @throws \Exception - */ public function change(Request $request) { $user = $request->user(); @@ -92,7 +84,7 @@ public function change(Request $request) $cancel = $tier == Pledge::KOBOLD; $isDowngrading = $this->subscription->downgrading(); $isYearly = $period === 'yearly'; - $hasPromo = \Carbon\Carbon::create(2023, 11, 28)->isFuture(); + $hasPromo = false; //\Carbon\Carbon::create(2023, 11, 28)->isFuture(); $limited = $this->subscription->isLimited(); if ($user->hasPayPal()) { $limited = true;