Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Adds some basic defense to getAllBulkCertificates
Browse files Browse the repository at this point in the history
  • Loading branch information
bomoko committed Dec 15, 2020
1 parent 29182a7 commit 950cb44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Fastly/Types/FastlyCertificates.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ public function getAllBulkCertificates()
$currentPage = $certificateData['meta'][0]['current_page'];
$totalPages = $certificateData['meta'][0]['total_pages'];

if(!is_numeric($currentPage) || !is_numeric($totalPages)) {
throw new \Exception("Call to getAllBulkCertificates resulted in bad results from Fastly API");
}

if ($currentPage >= $totalPages) {
$lastPage = true;
} else {
Expand Down

0 comments on commit 950cb44

Please sign in to comment.