Skip to content

fix(site): validate the site name and quote remote database check commands - #117

Merged
mrrobot47 merged 3 commits into
EasyEngine:developfrom
mrrobot47:fix/site-name-validation
Oct 12, 2026
Merged

mrrobot47 merged 3 commits into
EasyEngine:developfrom
mrrobot47:fix/site-name-validation

Conversation

@mrrobot47

Copy link
Copy Markdown
Member

Calls site-command's site-name validation on create (when available, EasyEngine/site-command#509), and quotes the values passed to the remote database check commands.

Validate the site name with site-command's validate_site_name() right after it is lowercased, before anything touches the shell, the file system or docker. Needs the site-command release that adds validate_site_name().
The remote DB checks on php site create put the DB host, port, user, password and the DB name (derived from the site name by default) in hand-written quotes nested inside a double-quoted sh -c/bash -c script, so a value containing a quote or shell syntax was not passed through as one argument. Quote each value for the inner shell and the whole script for the host shell with escapeshellarg().
… check

site-command's create router validates the name as well; the guard keeps site-type-php working next to an older site-command instead of failing with an undefined function.
@mrrobot47
mrrobot47 requested a balanced review from Copilot October 12, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Remote checks remain unreachable, and database names are still interpolated unsafely into SQL.

2 open findings

🧠 Review effort: Balanced

Comment thread src/PHP.php
Comment thread src/PHP.php
@mrrobot47
mrrobot47 merged commit 977e42a into EasyEngine:develop Oct 12, 2026
3 checks passed
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