Skip to content

Commit 5ed9160

Browse files
author
James Isbell
committed
Fix where renaming a file fails when alphanumeric directory is true
1 parent 7f07972 commit 5ed9160

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Controllers/RenameController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ public function getRename()
3333
}
3434
}
3535

36-
if (config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $new_name)) {
36+
if ($is_directory && config('lfm.alphanumeric_directory') && preg_match('/[^\w-]/i', $new_name)) {
3737
return parent::error('folder-alnum');
38-
// return parent::error('file-alnum');
38+
}
39+
else if (config('lfm.alphanumeric_filename') && preg_match('/[^.\w-]/i', $new_name)) {
40+
return parent::error('file-alnum');
3941
} elseif ($this->lfm->setName($new_name)->exists()) {
4042
return parent::error('rename');
4143
}

0 commit comments

Comments
 (0)