From 23d2352a9b2b8f21785443c13e2696c44f6a48fe Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sun, 1 Nov 2020 14:27:14 -0800 Subject: [PATCH] Don't ever return per_page as a string here... --- .../Api/Remote/Servers/ServerDetailsController.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php b/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php index d18c0921f..99ba71362 100644 --- a/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php +++ b/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php @@ -5,7 +5,6 @@ namespace Pterodactyl\Http\Controllers\Api\Remote\Servers; use Illuminate\Http\Request; use Pterodactyl\Models\Server; use Illuminate\Http\JsonResponse; -use Illuminate\Support\Facades\DB; use Pterodactyl\Http\Controllers\Controller; use Pterodactyl\Repositories\Eloquent\NodeRepository; use Pterodactyl\Services\Eggs\EggConfigurationService; @@ -84,7 +83,9 @@ class ServerDetailsController extends Controller // within each of the services called below. $servers = Server::query()->with('allocations', 'egg', 'mounts', 'variables', 'location') ->where('node_id', $node->id) - ->paginate($request->input('per_page', 50)); + // If you don't cast this to a string you'll end up with a stringified per_page returned in + // the metadata, and then Wings will panic crash as a result. + ->paginate((int)$request->input('per_page', 50)); return new ServerConfigurationCollection($servers); }