Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Refactor and and guard namespace extraction #451

Merged

Conversation

NamelessCoder
Copy link
Member

Refactors the namespace validation from occurring in
the TemplateProcessor, to occur instead when parsing
the template. Behavior remains unchanged.

Also guards several potentially empty matches of
namespaces from being iterated over, causing fatal
PHP errors.

@coveralls
Copy link

coveralls commented May 10, 2019

Coverage Status

Coverage increased (+0.02%) to 97.164% when pulling 7c35dfc on NamelessCoder:hotfix/namespace-extraction-issues into 865890c on TYPO3:master.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 1199

  • 34 of 34 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 97.379%

Totals Coverage Status
Change from base Build 1198: -0.01%
Covered Lines: 2601
Relevant Lines: 2671

💛 - Coveralls

Refactors the namespace validation from occurring in
the TemplateProcessor, to occur instead when parsing
the template. Behavior remains unchanged.

Also guards several potentially empty matches of
namespaces from being iterated over, causing fatal
PHP errors.
@NamelessCoder NamelessCoder force-pushed the hotfix/namespace-extraction-issues branch from 4a20db8 to 0d6eb68 Compare June 3, 2019 13:13
@NamelessCoder
Copy link
Member Author

@mbrodala Could I have you do a quick re-review (reading is enough) and if OK, merge? I need to prepare a new release today if we want to solve (work around) the regular expression backtrack issues in CMS.

@mbrodala mbrodala merged commit 2d2d5db into TYPO3:master Jul 23, 2019
@mbrodala
Copy link
Member

Done that now. Given the complexity I'd wanted to at least do some tests but it's probably fine.

NamelessCoder added a commit that referenced this pull request Sep 8, 2019
Refactors the namespace validation from occurring in
the TemplateProcessor, to occur instead when parsing
the template. Behavior remains unchanged.

Also guards several potentially empty matches of
namespaces from being iterated over, causing fatal
PHP errors.
NamelessCoder added a commit that referenced this pull request Sep 8, 2019
Refactors the namespace validation from occurring in
the TemplateProcessor, to occur instead when parsing
the template. Behavior remains unchanged.

Also guards several potentially empty matches of
namespaces from being iterated over, causing fatal
PHP errors.
@bwaidelich
Copy link

Hi guys,

Behavior remains unchanged.

not 100% sure, but it seems that the behavior did change in fact.

Assume:

{namespace f*}{namespace bar}<foo:bar /><bar:foo></bar:foo><foo.bar:baz /><f:format.raw>foobar</f:format.raw>

Result before:

<foo:bar /><bar:foo></bar:foo><foo.bar:baz />foobar

Result now:

<foo:bar /><bar:foo></bar:foo><foo.bar:baz /><f:format.raw>foobar</f:format.raw>

And the reason is that registered namespaces took precedence over ignored namespaces before and no longer do now.

(see neos/flow-development-collection#1761 for more details)

NamelessCoder added a commit that referenced this pull request Sep 9, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Sep 12, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Sep 12, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
mbrodala pushed a commit that referenced this pull request Sep 12, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Sep 12, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Sep 12, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
@kdambekalns
Copy link
Contributor

With 2.6.6 this seems to be back for us, see neos/flow-development-collection#1761

@kdambekalns
Copy link
Contributor

kdambekalns commented Nov 4, 2019

… and it seems quite logical, looking at f8c0fb3 that went into 2.6.6 as per 2.6.5...2.6

What is the background for the revert? I can't seem to find a changelog… 😳

NamelessCoder added a commit to NamelessCoder/Fluid that referenced this pull request Nov 4, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: TYPO3#451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
mbrodala pushed a commit that referenced this pull request Nov 5, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Nov 5, 2019
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Feb 3, 2020
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
NamelessCoder added a commit that referenced this pull request Feb 3, 2020
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: #451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
CDRO pushed a commit to CDRO/Fluid that referenced this pull request Oct 26, 2021
Refactors the namespace validation from occurring in
the TemplateProcessor, to occur instead when parsing
the template. Behavior remains unchanged.

Also guards several potentially empty matches of
namespaces from being iterated over, causing fatal
PHP errors.
CDRO pushed a commit to CDRO/Fluid that referenced this pull request Oct 26, 2021
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: TYPO3#451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
CDRO pushed a commit to CDRO/Fluid that referenced this pull request Oct 26, 2021
Fixes a regression in namespace resolving behavior,
wherein a conflicting ignored namespace (e.g. "f*")
incorrectly caused the registered namespace to be
ignored (e.g. "f:" would be ignored).

References: TYPO3#451
References: neos/flow-development-collection#1761
Signed-off-by: Claus Due <claus@namelesscoder.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants