You are here

public function AFile::checkForErrors in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Returns do we need to continue check or not.

2 calls to AFile::checkForErrors()
FileUploaded::checkForErrors in src/Flmngr/FileUploaderServer/lib/file/FileUploaded.php
Returns do we need to continue check or not.
FileUploadedQuick::checkForErrors in src/Flmngr/FileUploaderServer/lib/file/FileUploadedQuick.php
Returns do we need to continue check or not.
2 methods override AFile::checkForErrors()
FileUploaded::checkForErrors in src/Flmngr/FileUploaderServer/lib/file/FileUploaded.php
Returns do we need to continue check or not.
FileUploadedQuick::checkForErrors in src/Flmngr/FileUploaderServer/lib/file/FileUploadedQuick.php
Returns do we need to continue check or not.

File

src/Flmngr/FileUploaderServer/lib/file/AFile.php, line 101

Class

AFile
Abstract file item both for just uploaded and fully commited files. Contains some handy method for accessing files info programmatically.

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib\file

Code

public function checkForErrors($checkForExist) {
  $this->commonErrors = [];
  if (!Utils::isFileNameSyntaxOk($this
    ->getName())) {
    $this->commonErrors[] = Message::createMessage(Message::FILE_ERROR_SYNTAX, $this
      ->getName());

    // Do not do any other checks by security reasons.
    return FALSE;
  }
  if ($checkForExist && !$this
    ->exists()) {
    $this->commonErrors[] = Message::createMessage(Message::FILE_ERROR_DOES_NOT_EXIST);
  }
  return TRUE;
}