Skip to content

Make improvements to parseDSN method - #284

Open
smg6511 wants to merge 6 commits into
modxcms:3.xfrom
smg6511:3.x-refactor-parseDSN
Open

Make improvements to parseDSN method#284
smg6511 wants to merge 6 commits into
modxcms:3.xfrom
smg6511:3.x-refactor-parseDSN

Conversation

@smg6511

@smg6511 smg6511 commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Refactors the parseDSN method to simplify logic and prevent issues with trailing semi-colons in evaluated string. There was an edge case in MODX where a trailing semi caused the dbname to be blank when it was, in fact, present in the string being evaluated.

smg6511 added 4 commits July 3, 2026 21:42
Refactor to simplify logic and prevent issues with trailing semi-colons in evaluated string
Add sqlite-specific parsing for parseDSN method
Prevent trying to access undefined key in foreach
Fix accessing undefined value
@smg6511
smg6511 marked this pull request as draft July 31, 2026 06:40
Ok, I think I get it with sqlite now (removing extra params evaluation that's not relevant for that db type) ... sorry for all the commits.
@smg6511
smg6511 marked this pull request as ready for review July 31, 2026 15:29
Ensure to initially split non-sqlite dns strings only on the first colon (allows colon use in  params)
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