Your project uses non-strict array lookups 3
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- // Extract statement type
- $stmt_type = strtoupper(trim(explode(' ', $sql)[0]));
- // Whitelist allowed SQL types
- if (!in_array($stmt_type, $allowed_statements)) {
- $CLICSHOPPING_MessageStack->add('Restore skipped: unsupported SQL statement type (' . $stmt_type . ')', 'warning');
- continue;
- }
- // Validate DROP TABLE statements to prevent SQL injection
- }
- // Optional: Whitelist specific domains (e.g., GitHub)
- // Uncomment and modify as needed:
- $allowed_domains = ['github.com', 'api.github.com'];
- if (!in_array($parsed_url['host'] ?? '', $allowed_domains)) {
- $this->messageStack->add('Download from unauthorized domain', 'error');
- CLICSHOPPING::redirect('Upgrade&Marketplace');
- return null;
- }
- $flags['session_id'] = false;
- }
- // Security: Validate method against whitelist
- $allowed_methods = ['post', 'get'];
- $safe_method = in_array(strtolower($method ?? 'post'), $allowed_methods) ? strtolower($method ?? 'post') : 'post';
- // Security: Sanitize form action URL
- $safe_action = static::sanitizeUrl($action);
- $form = '<form name="' . static::outputProtected($name) . '" action="' . $safe_action . '" method="' . $safe_method . '"';