Skip to content

ref(dsn): Initialize $matches before preg_match to drop Mago baseline entry - #2410

Draft
sentry-junior[bot] wants to merge 1 commit into
masterfrom
chore/mago-baseline-dsn-matches
Draft

sentry-junior[bot] wants to merge 1 commit into
masterfrom
chore/mago-baseline-dsn-matches

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Removes this Mago baseline entry:

  • src/Dsn.php: reference-to-undefined-variable: Reference created from a previously undefined variable `$matches`. (count 1)

Dsn::createFromString() passed an undeclared $matches by reference to preg_match() when extracting the org ID from the host. It now sets $matches = [] first.

This is safe: preg_match() always overwrites $matches, and the variable is only read when the match succeeds, so behavior is unchanged.

via automation sched_a59acc45df166a80a839d0b32321e740 · Run ID sched_a59acc45df166a80a839d0b32321e740:1795251600000.

--

View Session [Sentry]

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.

0 participants