Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check warning on line 1 in inc/integrations/providers/laravel-forge/class-laravel-forge-integration.php

View workflow job for this annotation

GitHub Actions / Code Quality Checks

Class file names should be based on the class name with "class-" prepended. Expected class-laravelforge-integration.php, but found class-laravel-forge-integration.php.
/**
* Laravel Forge Integration.
*
Expand Down Expand Up @@ -265,6 +265,18 @@
$symlink_target = $this->get_credential('WU_FORGE_SYMLINK_TARGET');

if ($deploy_command) {
// Validate domain to prevent shell command injection via metacharacters,
// mirroring the symlink branch below.
if (! preg_match('/^[a-z0-9][a-z0-9\-\.]*[a-z0-9]$/i', $domain)) {
wu_log_add(
'integration-forge',
sprintf('Invalid domain format rejected for shell command: %s', $domain),
\Psr\Log\LogLevel::ERROR
);

return '';
}

return str_replace('{domain}', $domain, $deploy_command);
}

Expand Down
9 changes: 8 additions & 1 deletion inc/ui/class-domain-mapping-element.php
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,14 @@ public function render_add_dns_record_modal(): void {
}

$dns_manager = \WP_Ultimo\Managers\DNS_Record_Manager::get_instance();
$provider = $dns_manager->get_dns_provider();

// Same ownership gate the edit/add/delete DNS handlers enforce.
if (! $dns_manager->customer_can_manage_dns(get_current_user_id(), $domain->get_domain())) {
wp_send_json_error(new \WP_Error('permission-denied', __('You do not have permission to manage DNS for this domain.', 'ultimate-multisite')));
return;
}

$provider = $dns_manager->get_dns_provider();

wu_get_template(
'domain/dns-record-form',
Expand Down
Loading