1.20.x filetransfer.inc FileTransfer::sanitizePath($path)

Changes backslashes to slashes, also removes a trailing slash.

Parameters

string $path:

Return value

string:

File

includes/filetransfer/filetransfer.inc, line 206
Base FileTransfer class.

Class

FileTransfer
@file Base FileTransfer class.

Code

function sanitizePath($path) {
  $path = str_replace('\\', '/', $path); // Windows path sanitization.
  if (substr($path, -1) == '/') {
    $path = substr($path, 0, -1);
  }
  return $path;
}