You are here

public static function Utils::fixFileName in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Fixes file name.

1 call to Utils::fixFileName()
URLDownloader::downloadUrl in src/Flmngr/FileUploaderServer/lib/file/URLDownloader.php
Downloads URL.

File

src/Flmngr/FileUploaderServer/lib/file/Utils.php, line 56

Class

Utils
Utilites for uploader.

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib\file

Code

public static function fixFileName($name) {
  $newName = "";
  for ($i = 0; $i < strlen($name); $i++) {
    $ch = substr($name, $i, 1);
    if (strpos(Utils::PROHIBITED_SYMBOLS, $ch) !== FALSE) {
      $ch = "_";
    }
    $newName = $newName . $ch;
  }
  return $newName;
}