Skip to content

Commit

Permalink
Check not only for hash event for mask too.
Browse files Browse the repository at this point in the history
Resolve problems with assets which are used in different context like html tag and inline css
  • Loading branch information
Martin Tepper committed Oct 30, 2023
1 parent 2cb9525 commit 084f327
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Domain/Model/Asset/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public function __construct()
public function append($asset)
{
$elementHash = $asset->getHash();
if (in_array($elementHash, $this->elementHashes)) {
$found = array_search($elementHash, $this->elementHashes);

// Check if hash exists and if mask is equal
if (false !== $found && $asset->getMask() === $this[$found]->getMask()) {
return;
}
$this->elementHashes[] = $elementHash;
Expand Down

0 comments on commit 084f327

Please sign in to comment.