You are here

protected function ActionUploadCommit::validateSizes in N1ED - Visual editor as CKEditor plugin with Bootstrap support 7

1 call to ActionUploadCommit::validateSizes()
ActionUploadCommit::run in vendor/edsdk/file-uploader-server-php/src/lib/action/ActionUploadCommit.php

File

vendor/edsdk/file-uploader-server-php/src/lib/action/ActionUploadCommit.php, line 32

Class

ActionUploadCommit

Namespace

EdSDK\FileUploaderServer\lib\action

Code

protected function validateSizes($req) {
  if (!isset($req->sizes) || $req->sizes === NULL) {
    $req->sizes = [];
  }
  else {
    $sizesNames = [
      "full",
      "preview",
    ];

    //theoretical workaround for 7.4
    $req->sizes = (array) $req->sizes;
    for ($i = 0; $i < count($sizesNames); $i++) {
      $sizeName = $sizesNames[$i];
      if ($req->sizes[$sizeName]) {
        $this
          ->validateSize($req->sizes[$sizeName], $sizeName);
      }
    }
  }
}