Bug #94714

SvgFilesSanitization prevent subsequent file search

Added by Pierrick Caillon 4 months ago. Updated 3 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2021-08-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

Description

The method SvgFilesSanitization::resolveSvgFiles set up a file extension filter in every resource storage. However, it does not reset the filter after use.

It prevents the usage of FormPersistenceManager::listForms to retrieve the forms to check them in some own update wizard. Or any other file searching which expect the filters to be defaulted.

A trivial fix would be in svgfilessanitization.patch.

Another solution would be to update FormPersistenceManager to replace the filters instead of adding, in formpersistencemanager.patch.

Or maybe do both?

Introduced since #94492


Files

svgfilessanitization.patch (1.14 KB) svgfilessanitization.patch Pierrick Caillon, 2021-08-04 17:20
formpersistencemanager.patch (1 KB) formpersistencemanager.patch Pierrick Caillon, 2021-08-04 17:23
SomeFormWizard.php (1.79 KB) SomeFormWizard.php Bare update wizard for testing Pierrick Caillon, 2021-08-04 17:37

Related issues

Related to TYPO3 Core - Task #94492: Introduce t3g/svg-sanitizerClosedOliver Hader2021-07-06

Actions
#1

Updated by Pierrick Caillon 4 months ago

  • Related to Task #94492: Introduce t3g/svg-sanitizer added
#2

Updated by Oliver Hader 4 months ago

  • TYPO3 Version changed from 10 to 9
#3

Updated by Oliver Hader 4 months ago

  • Status changed from New to Needs Feedback

Thx for the report. Can you please give a short step-by-step example on how to trigger/reproduce the misbehavior? Thx!

#4

Updated by Pierrick Caillon 4 months ago

Attached in SomeFormWizard.php, a bare upgrade wizard to reproduce. The wizard must be registered as defined in documentation

You should have typo3/cms-form installed and active, and have at least one form definition in your instance.

The wizard will show up when there is a form in the instance.

The SvgFilesSanitization wizard must not have been run, or there is no SVG in your resource storages for it to be run before.

#5

Updated by Pierrick Caillon 4 months ago

  • Description updated (diff)
#6

Updated by Oliver Hader 4 months ago

  • Status changed from Needs Feedback to Accepted

Thanks for the feedback & I see...
\TYPO3\CMS\Core\Resource\StorageRepository::$storageInstances actually leads to Storage objects being handled like singletons - which shows the software design flaw, since (individual) filters should be separated from (more or less) static file-storage models.

#7

Updated by Gerrit Code Review 4 months ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70211

#8

Updated by Oliver Hader 4 months ago

@Pierrick, I've create a change request at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70211, referring to you as author since you provided the patch files.

#9

Updated by Gerrit Code Review 4 months ago

Patch set 1 for branch 11.3 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70295

#10

Updated by Gerrit Code Review 4 months ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70296

#11

Updated by Gerrit Code Review 4 months ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70297

#12

Updated by Pierrick Caillon 4 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#13

Updated by Pierrick Caillon 4 months ago

@Oliver: Thanks.

#14

Updated by Benni Mack 3 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF