Skip to content

Fix regex pattern for bbcode attachment matches#6579

Closed
SoftCreatR wants to merge 1 commit intoWoltLab:6.2from
SoftCreatR:patch-2
Closed

Fix regex pattern for bbcode attachment matches#6579
SoftCreatR wants to merge 1 commit intoWoltLab:6.2from
SoftCreatR:patch-2

Conversation

@SoftCreatR
Copy link
Contributor

After saving, attachment BBCodes may be normalized from [attach=1612][/attach] to [attach='1612'][/attach] (or double-quoted), which caused inserted-attachment detection to fail on edit.

This change updates the BBCode matcher to capture numeric IDs regardless of optional single/double quotes around the ID, so previously inserted attachments are correctly recognized in all formats.

  • before: matched quoted IDs but parsed NaN
  • after: captures digits only and parses reliably

Capture only digits in group 1, so parseInt(match[1], 10) works for quoted and unquoted IDs.
dtdesign added a commit that referenced this pull request Feb 13, 2026
@dtdesign dtdesign closed this Feb 13, 2026
@SoftCreatR SoftCreatR deleted the patch-2 branch February 13, 2026 14:42
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.

2 participants