Skip to content

Commit

Permalink
[BUGFIX] Update missing file properties
Browse files Browse the repository at this point in the history
Do not expect all properties to already exist.
Update properties with different value as well as missing properties.

This check also prevents PHP 8.x warnings due to accessing unavailable
array keys.

Resolves: #98387
Releases: main, 11.5
Change-Id: I9c907174acd79ebf6623ffeecbee2f9da3ae463d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75814
Tested-by: core-ci <typo3@b13.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
  • Loading branch information
DanielSiepmann authored and lolli42 committed Sep 21, 2022
1 parent 56198c2 commit 1ca828a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typo3/sysext/core/Classes/Resource/File.php
Expand Up @@ -181,7 +181,7 @@ public function updateProperties(array $properties)
unset($properties['uid']);
}
foreach ($properties as $key => $value) {
if ($this->properties[$key] !== $value) {
if (!isset($this->properties[$key]) || $this->properties[$key] !== $value) {
if (!in_array($key, $this->updatedProperties)) {
$this->updatedProperties[] = $key;
}
Expand Down

0 comments on commit 1ca828a

Please sign in to comment.