You are here

public function FilebrowserValidator::safeDirName in Filebrowser 3.x

Same name and namespace in other branches
  1. 8.2 src/Services/FilebrowserValidator.php \Drupal\filebrowser\Services\FilebrowserValidator::safeDirName()

File

src/Services/FilebrowserValidator.php, line 62

Class

FilebrowserValidator

Namespace

Drupal\filebrowser\Services

Code

public function safeDirName($path) {
  $path = rtrim($path, '/');
  $path = explode('/', $path);
  array_pop($path);
  $result = implode("/", $path);
  if ($result == '') {
    return '/';
  }
  return $result;
}