You are here

function ServiceAuditFilesNotInDatabase::_auditfiles_not_in_database_fix_path_separators in Audit Files 8

Corrects the separators of a file system's file path.

Changes the separators of a file path, so they are match the ones being used on the operating system the site is running on.

Parameters

string $path: The path to correct.

Return value

string The corrected path.

1 call to ServiceAuditFilesNotInDatabase::_auditfiles_not_in_database_fix_path_separators()
ServiceAuditFilesNotInDatabase::_auditfiles_not_in_database_get_files_for_report in src/ServiceAuditFilesNotInDatabase.php
Get files for report.

File

src/ServiceAuditFilesNotInDatabase.php, line 191
providing the service that used in not in database functionality.

Class

ServiceAuditFilesNotInDatabase

Namespace

Drupal\auditfiles

Code

function _auditfiles_not_in_database_fix_path_separators($path) {
  $path = preg_replace('@\\/\\/@', DIRECTORY_SEPARATOR, $path);
  $path = preg_replace('@\\\\@', DIRECTORY_SEPARATOR, $path);
  return $path;
}