Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/MultipartStreamBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,11 @@ private function basename($path)
// For Windows OS add special separator.
$separators .= DIRECTORY_SEPARATOR;
}
// Remove right-most slashes when $uri points to directory.

// Remove right-most slashes when $path points to directory.
$path = rtrim($path, $separators);
// Returns the trailing part of the $uri starting after one of the directory
// separators.

// Returns the trailing part of the $path starting after one of the directory separators.
$filename = preg_match('@[^'.preg_quote($separators, '@').']+$@', $path, $matches) ? $matches[0] : '';

return $filename;
Expand Down