Fix case sensitivity issue with determining "upload_max_filesize" size

Fixes https://github.com/wintercms/winter/issues/788
This commit is contained in:
Ben Thomson 2023-06-11 19:43:09 +08:00 committed by GitHub
parent ad427a621a
commit 02cbd8654a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -518,7 +518,7 @@ class FileUpload extends FormWidgetBase
{
$size = ini_get('upload_max_filesize');
if (preg_match('/^([\d\.]+)([KMG])$/i', $size, $match)) {
$pos = array_search($match[2], ['K', 'M', 'G']);
$pos = array_search(strtoupper($match[2]), ['K', 'M', 'G']);
if ($pos !== false) {
$size = $match[1] * pow(1024, $pos + 1);
}