Skip to content

[ticket/17647] Do not treat gallery buttons as the avatar form submit#6993

Open
ECYaz wants to merge 1 commit into
phpbb:masterfrom
ECYaz:ticket/17647
Open

[ticket/17647] Do not treat gallery buttons as the avatar form submit#6993
ECYaz wants to merge 1 commit into
phpbb:masterfrom
ECYaz:ticket/17647

Conversation

@ECYaz

@ECYaz ECYaz commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Checklist:

  • Correct branch: master for 4.x fixes
  • Tests pass
  • Code follows coding guidelines
  • Commit follows commit message format

Tracker ticket:

https://tracker.phpbb.com/browse/PHPBB-17647

The AJAX avatar upload copies the name and value of the form's submit button into the request so the server treats it as a regular submission. Selecting the first submit input in the form picks the gallery's "Go" button when gallery avatars are enabled, because the UCP templates render it as a direct fieldset child ahead of the real submit button. The server then responds with the gallery page instead of saving the upload, and the avatar is silently discarded.

Restricting the selection to the form's submit area (fieldset.submit-buttons in the UCP and ACP group forms, fieldset.quick in the ACP user form) picks the correct button in all four places the cropper runs. Reproduced and verified on a live board: with gallery avatars enabled, uploads on the UCP profile page and the UCP group management page previously posted avatar_local_go=Go and nothing was saved; with the fix both post the real submit button and the avatar is stored and displayed. The ACP user and group pages were unaffected by the bug (their "Go" button is not a direct fieldset child) and select the same button as before.

The AJAX avatar upload copies the submit button's name and value into
the request. Selecting the first submit input in the form picks the
gallery's "Go" button when gallery avatars are enabled, so the server
renders the gallery page instead of saving the uploaded avatar.
Restrict the selection to the form's own submit area.

PHPBB-17647
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.

1 participant