Skip to content

Commit 4b2bd57

Browse files
committed
update readme
1 parent b6cdd52 commit 4b2bd57

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,5 @@ PR is welcome!
4545
* [@1dot44mb](https://github.com/1dot44mb) tr translations.
4646
* [@Nikita240](https://github.com/Nikita240) fixing controller extending errors.
4747
* [@amin101](https://github.com/amin101) guide for independent use and fixes for url/directory error on Windows
48+
* [@nasirkhan](https://github.com/nasirkhan) bug fixes and alphanumeric filename check
4849
* All [@UniSharp](https://github.com/UniSharp) members

doc/config.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,39 +10,39 @@
1010
In `config/lfm.php` :
1111

1212
```php
13-
'rename_file' => true,
13+
'rename_file' => true,
1414
// true : files will be renamed as uniqid
1515
// false : files will remain original names
1616

17-
// true : filter filename characters which are not English or numbers, and replace them with '_'
18-
'check_filename' => true,
17+
// true : filter filename characters which are not alphanumeric, and replace them with '_'
18+
'alphanumeric_filename' => true,
1919

20-
'use_package_routes' => true,
20+
'use_package_routes' => true,
2121
// set this to false to customize route for file manager
2222

23-
'middlewares' => ['auth'],
23+
'middlewares' => ['auth'],
2424
// determine middlewares that apply to all file manager routes
2525
// NOTE: for laravel 5.2, please use ['web', 'auth']
2626

27-
'allow_multi_user' => true,
27+
'allow_multi_user' => true,
2828
// true : user can upload files to shared folder and their own folder
2929
// false : all files are put together in shared folder
3030

31-
'user_field' => 'id',
31+
'user_field' => 'id',
3232
// determine which column of users table will be used as user's folder name
3333

34-
'shared_folder_name' => 'shares',
34+
'shared_folder_name' => 'shares',
3535
// the name of shared folder
3636

37-
'thumb_folder_name' => 'thumbs',
37+
'thumb_folder_name' => 'thumbs',
3838
// the name of thumb folder
3939

40-
'images_dir' => 'public/photos/',
41-
'images_url' => '/photos/',
40+
'images_dir' => 'public/photos/',
41+
'images_url' => '/photos/',
4242
// path and url of images
4343

44-
'files_dir' => 'public/files/',
45-
'files_url' => '/files/',
44+
'files_dir' => 'public/files/',
45+
'files_url' => '/files/',
4646
// path and url of files
4747

4848

src/config/lfm.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,33 @@
22

33
return [
44
// If true, the uploaded file will be renamed to uniqid() + file extension.
5-
'rename_file' => true,
5+
'rename_file' => true,
66

7-
// If rename_file set to false and this set to true, then filter filename characters which are not English or numbers.
8-
'check_filename' => true,
7+
// If rename_file set to false and this set to true, then filter filename characters which are not alphanumeric.
8+
'alphanumeric_filename' => true,
99

10-
'use_package_routes' => true,
10+
'use_package_routes' => true,
1111

1212
// For laravel 5.2, please set to ['web', 'auth']
13-
'middlewares' => ['auth'],
13+
'middlewares' => ['auth'],
1414

1515
// Allow multi_user mode or not.
1616
// If true, laravel-filemanager create private folders for each signed-in user.
17-
'allow_multi_user' => true,
17+
'allow_multi_user' => true,
1818

1919
// The database field to identify a user.
2020
// When set to 'id', the private folder will be named as the user id.
2121
// NOTE: make sure to use an unique field.
22-
'user_field' => 'id',
22+
'user_field' => 'id',
2323

24-
'shared_folder_name' => 'shares',
25-
'thumb_folder_name' => 'thumbs',
24+
'shared_folder_name' => 'shares',
25+
'thumb_folder_name' => 'thumbs',
2626

27-
'images_dir' => 'public/photos/',
28-
'images_url' => '/photos/',
27+
'images_dir' => 'public/photos/',
28+
'images_url' => '/photos/',
2929

30-
'files_dir' => 'public/files/',
31-
'files_url' => '/files/',
30+
'files_dir' => 'public/files/',
31+
'files_url' => '/files/',
3232

3333
// available since v1.3.0
3434
'valid_image_mimetypes' => [

src/controllers/UploadController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private function getNewName($file)
104104

105105
if (Config::get('lfm.rename_file') === true) {
106106
$new_filename = uniqid();
107-
} elseif (Config::get('lfm.check_filename') === true) {
107+
} elseif (Config::get('lfm.alphanumeric_filename') === true) {
108108
$new_filename = preg_replace('/[^A-Za-z0-9\-\']/', '_', $file->getClientOriginalName());
109109
}
110110

0 commit comments

Comments
 (0)