diff --git a/core/modules/file/lib/Drupal/file/Plugin/field/field_type/FileItem.php b/core/modules/file/lib/Drupal/file/Plugin/field/field_type/FileItem.php index 7dac328..2341dc5 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/field/field_type/FileItem.php +++ b/core/modules/file/lib/Drupal/file/Plugin/field/field_type/FileItem.php @@ -258,7 +258,7 @@ public static function validateExtensions($element, &$form_state) { * instanceSettingsForm(). */ public static function validateMaxFilesize($element, &$form_state) { - if (!empty($element['#value']) && !is_numeric(Byte::parseSize($element['#value']))) { + if (!empty($element['#value']) && !is_numeric(Bytes::parseSize($element['#value']))) { form_error($element, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array('!name' => t($element['title'])))); } } @@ -296,9 +296,9 @@ public function getUploadValidators() { $settings = $this->getFieldSettings(); // Cap the upload size according to the PHP limit. - $max_filesize = Byte::parseSize(file_upload_max_size()); + $max_filesize = Bytes::parseSize(file_upload_max_size()); if (!empty($settings['max_filesize'])) { - $max_filesize = min($max_filesize, Byte::parseSize($settings['max_filesize'])); + $max_filesize = min($max_filesize, Bytes::parseSize($settings['max_filesize'])); } // There is always a file size limit due to the PHP server limit.