*
* @return string The file extension of the file.
*/
- public function fileExtension(array $file):?string
+ public function fileExtension(array $file):string | bool
{
if(str_contains($file['name'], '.')){
$extension = explode('.', $file['name']);
default => end($extension)
};
}
- return "NOEXT";
+ return false;
}
/**
$index = rand(0, strlen($this->Connector->CONFIG['ID_CHARSET']) - 1);
$NEW_NAME .= $this->Connector->CONFIG['ID_CHARSET'][$index];
}
- if ($extension != "NOEXT") {
+ if ($extension) {
$NEW_NAME .= '.' . $extension;
}
} while ($this->Connector->dbCheckNameExists($NEW_NAME));