Skip to content

Commit

Permalink
fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Feb 17, 2024
1 parent bbd8b8c commit a0949bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Forms/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static function sanitize(int $type, $value)
{
if ($type === Form::DataText) {
return is_scalar($value)
? Strings::normalizeNewLines($value)
? Strings::normalizeNewLines((string) $value)
: null;

} elseif ($type === Form::DataLine) {
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public static function validateMimeType(Controls\UploadControl $control, $mimeTy
{
$mimeTypes = is_array($mimeType) ? $mimeType : explode(',', $mimeType);
foreach (static::toArray($control->getValue()) as $file) {
$type = strtolower($file->getContentType());
$type = strtolower($file->getContentType() ?? '');
if (!in_array($type, $mimeTypes, true) && !in_array(preg_replace('#/.*#', '/*', $type), $mimeTypes, true)) {
return false;
}
Expand Down

0 comments on commit a0949bc

Please sign in to comment.