Skip to content

Commit 23d2352

Browse files
committed
Don't ever return per_page as a string here...
1 parent 4082503 commit 23d2352

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Illuminate\Http\Request;
66
use Pterodactyl\Models\Server;
77
use Illuminate\Http\JsonResponse;
8-
use Illuminate\Support\Facades\DB;
98
use Pterodactyl\Http\Controllers\Controller;
109
use Pterodactyl\Repositories\Eloquent\NodeRepository;
1110
use Pterodactyl\Services\Eggs\EggConfigurationService;
@@ -84,7 +83,9 @@ public function list(Request $request)
8483
// within each of the services called below.
8584
$servers = Server::query()->with('allocations', 'egg', 'mounts', 'variables', 'location')
8685
->where('node_id', $node->id)
87-
->paginate($request->input('per_page', 50));
86+
// If you don't cast this to a string you'll end up with a stringified per_page returned in
87+
// the metadata, and then Wings will panic crash as a result.
88+
->paginate((int)$request->input('per_page', 50));
8889

8990
return new ServerConfigurationCollection($servers);
9091
}

0 commit comments

Comments
 (0)