Skip to content

[stable35] fix(AppFramework): Safely parse parenthesised annotations without equals - #67715

Open
backportbot[bot] wants to merge 1 commit into
stable35from
backport/64958/stable35
Open

backportbot[bot] wants to merge 1 commit into
stable35from
backport/64958/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Dec 5, 2026

Copy link
Copy Markdown

Backport of PR #64958

In ControllerMethodReflector::reflect(), parenthesised annotations were
unconditionally split on '=', assuming every entry followed a key=value
format. For annotations without '=' (such as @SuppressWarnings(PHPMD.X)),
exploding without '=' returned a 1-element array, triggering PHP warnings:
'Undefined array key 1'.

- Only split on '=' when '=' is present in the annotation element.
- Avoid shadowing outer foreach loop variable $key with param key.
- Add unit test testGetAnnotationParenthesisedWithoutEquals.

Fixes #64861

Signed-off-by: sundeep8967 <sundeep8967@gmail.com>
@backportbot
backportbot Bot requested a review from a team as a code owner December 5, 2026 20:12
@backportbot
backportbot Bot requested review from come-nc, leftybournes, salmart-dev and skjnldsv and removed request for a team December 5, 2026 20:12
@backportbot backportbot Bot added 3. to review Waiting for reviews feedback-requested labels Dec 5, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.4 milestone Dec 5, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant