Skip to content

Commit

Permalink
Merge branch '5.0' into 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed Mar 12, 2021
2 parents 08f1bcc + e04e788 commit 99c9400
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Classes/Core/Runtime/FormRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected function initializeFormStateFromRequest()
$this->formState = new FormState();
} else {
$serializedFormState = $this->hashService->validateAndStripHmac($serializedFormStateWithHmac);
$this->formState = unserialize(base64_decode($serializedFormState), ['allowed_classes' => [FormState::class]]);
$this->formState = unserialize(base64_decode($serializedFormState), ['allowed_classes' => [FormState::class, \DateTime::class, \DateTimeImmutable::class]]);
}
}

Expand Down
7 changes: 4 additions & 3 deletions Classes/ViewHelpers/Form/UploadedImageViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Neos\Flow\Property\PropertyMapper;
use Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper;
use Neos\Media\Domain\Model\Image;
use Neos\Media\Domain\Model\ImageInterface;

/**
* This ViewHelper makes the specified Image object available for its
Expand Down Expand Up @@ -73,17 +74,17 @@ public function render(): string
* Returns a previously uploaded image.
* If errors occurred during property mapping for this property, NULL is returned
*
* @return Image
* @return ImageInterface
* @throws \Neos\Flow\Property\Exception
* @throws \Neos\Flow\Security\Exception
*/
protected function getUploadedImage(): ?Image
protected function getUploadedImage(): ?ImageInterface
{
if ($this->getMappingResultsForProperty()->hasErrors()) {
return null;
}
$image = $this->getPropertyValue();
if ($image instanceof Image) {
if ($image instanceof ImageInterface) {
return $image;
}
return $this->propertyMapper->convert($this->getValueAttribute(), Image::class);
Expand Down

0 comments on commit 99c9400

Please sign in to comment.