You are here

private function Finder::normalizeDir in Database Sanitize 7

Normalizes given directory names by removing trailing slashes.

Excluding: (s)ftp:// wrapper

Parameters

string $dir:

Return value

string

1 call to Finder::normalizeDir()
Finder::in in vendor/symfony/finder/Finder.php
Searches files and directories which match defined rules.

File

vendor/symfony/finder/Finder.php, line 741

Class

Finder
Finder allows to build rules to find files and directories.

Namespace

Symfony\Component\Finder

Code

private function normalizeDir($dir) {
  $dir = rtrim($dir, '/' . \DIRECTORY_SEPARATOR);
  if (preg_match('#^s?ftp://#', $dir)) {
    $dir .= '/';
  }
  return $dir;
}