Update Core\Files
Get an extension through the regular. The previous version allowed backslashes and forward slashes in the file extension.
This commit is contained in:
parent
9854e5fd92
commit
23ab6ff1b3
1 changed files with 4 additions and 4 deletions
|
@ -1023,12 +1023,12 @@ class Files
|
|||
return null;
|
||||
}
|
||||
|
||||
if (false === ($pos = \strrpos($file['name'], '.'))) {
|
||||
if (\preg_match('%^(.+)\.([^.\\/]++)$%D', $file['name'], $matches)) {
|
||||
$name = $matches[1];
|
||||
$ext = $matches[2];
|
||||
} else {
|
||||
$name = $file['name'];
|
||||
$ext = null;
|
||||
} else {
|
||||
$name = \substr($file['name'], 0, $pos);
|
||||
$ext = \strtolower(\substr($file['name'], $pos + 1));
|
||||
}
|
||||
|
||||
$imageExt = $this->isImage($file['tmp_name']);
|
||||
|
|
Loading…
Add table
Reference in a new issue