mirror of
https://github.com/yiisoft/yii2.git
synced 2025-10-31 02:28:35 +08:00
Fix #18239: Fix support of no-extension files for FileValidator::validateExtension()
This commit is contained in:
@ -413,7 +413,7 @@ yii.validation = (function ($) {
|
||||
|
||||
for (var index=0; index < options.extensions.length; index++) {
|
||||
var ext = options.extensions[index].toLowerCase();
|
||||
if (filename.substr(filename.length - options.extensions[index].length - 1) === ('.' + ext)) {
|
||||
if ((ext === '' && filename.indexOf('.') === -1) || (filename.substr(filename.length - options.extensions[index].length - 1) === ('.' + ext))) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user