Skip to content

Commit

Permalink
escape brackets in glob
Browse files Browse the repository at this point in the history
  • Loading branch information
norkunas committed Jan 14, 2016
1 parent c8b7dc5 commit e74b514
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/YoutubeDl.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,8 @@ protected function processDownloadOutput($output)
if ($downloadedFilePath !== '/') {
$searchPattern = $downloadedFilePath.$searchPattern;
}
// http://php.net/manual/en/function.glob.php#75752
$searchPattern = str_replace('[', '[[]', $searchPattern);

$foundFiles = glob($searchPattern, $globFlags);
$audioFile = reset($foundFiles);
Expand Down

0 comments on commit e74b514

Please sign in to comment.