Skip to content

Commit

Permalink
allow files without an extension
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed May 11, 2015
1 parent 9303b8c commit c532484
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All Notable changes to `laravel-medialibrary` will be documented in this file

##1.1.2
- Files without extensions are now allowed

##1.1.1
- Added check to make sure the file that must be added to the medialibrary exists

Expand Down
2 changes: 1 addition & 1 deletion src/MediaLibraryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private function createMediaForFile($file, $collectionName, $addAsTemporary)
$media->name = $pathParts['filename'];
$media->url = $pathParts['basename'];
$media->path = $pathParts['basename'];
$media->extension = strtolower($pathParts['extension']);
$media->extension = isset($pathParts['extension']) ? strtolower($pathParts['extension']) : '';
$media->size = filesize($file);
$media->temp = $addAsTemporary;
$media->collection_name = $collectionName;
Expand Down

0 comments on commit c532484

Please sign in to comment.