diff -u b/core/modules/file/src/Plugin/Field/FieldType/FileItemMaxFileSizeValidator.php b/core/modules/file/src/Plugin/Field/FieldType/FileItemMaxFileSizeValidator.php --- b/core/modules/file/src/Plugin/Field/FieldType/FileItemMaxFileSizeValidator.php +++ b/core/modules/file/src/Plugin/Field/FieldType/FileItemMaxFileSizeValidator.php @@ -28,6 +28,7 @@ * * This function is assigned as an #element_validate callback in * fieldSettingsForm(). + * * @param array $element * A field element array. * @param \Drupal\Core\Form\FormStateInterface $form_state @@ -37,7 +38,7 @@ // Spaces are irrelevant to us. Bytes::toInt will process with or without // them. Make our lives easier by just doing away with them. - self::$size = self::stripSpacesFromString($element['#value']); + self::$size = self::stripWhitespaceFromString($element['#value']); // Having removed whitespace, if our string is now empty then the user // either entered nothing or a string of whitespace. Accept both cases as @@ -77,7 +78,7 @@ * @return string * Returns the inputted string with spaces removed. */ - private static function stripSpacesFromString($string) { + private static function stripWhitespaceFromString($string) { return trim(preg_replace('/\s+/', '', $string)); }