Your project uses dangerous command injection functions
- Read doc
- Security
- Critical
More information: https://insight.symfony.com/what-we-analyse/php.use_command_injection_function
- ];
- $cli = null;
- if (function_exists('shell_exec')) {
- $out = @shell_exec('php -r ' . escapeshellarg('echo (int)extension_loaded("apcu"), ",", (int)ini_get("apc.enabled"), ",", (int)ini_get("apc.enable_cli"), ",", (int)(function_exists("apcu_enabled") && apcu_enabled());') . ' 2>/dev/null');
- if (is_string($out) && substr_count($out, ',') === 3) {
- [$loaded, $enabled, $enable_cli, $usable] = explode(',', trim($out));
- $cli = [
- 'loaded' => (bool)$loaded,
Your project uses non-strict array lookups 4
- Read doc
- Reliability
- Major
More information: https://insight.symfony.com/what-we-analyse/php.strict_array_lookup
- {
- if (!$this->isEnabled()) {
- return $this->skip($this->app->getDef('skip_module_disabled'));
- }
- if (!in_array($invoice_status, [self::STATUS_INVOICE, self::STATUS_CANCEL, self::STATUS_CREDIT_NOTE])) {
- return $this->skip($this->app->getDef('skip_status_not_actionable') . ' (' . $invoice_status . ')');
- }
- if ($this->isAlreadySent($order_id)) {
- return $this->skip($this->app->getDef('skip_already_sent') . ' #' . $order_id);
- $msg = $this->app->getDef('error_oauth2_failed') . ' #' . $order_id;
- $this->writeOrderHistory($order_id, '[ERROR] ' . $msg, false);
- return $this->failure($msg);
- }
- $doc_type = in_array($invoice_status, [self::STATUS_CANCEL, self::STATUS_CREDIT_NOTE]) ? self::TYPE_CREDIT_NOTE : self::TYPE_INVOICE;
- $payload = $this->buildPayload($order_id, $customer, $info, $products, $totals, $doc_type);
- if ($payload === null) {
- $msg = $this->app->getDef('error_payload_failed');
- $this->writeOrderHistory($order_id, '[ERROR] ' . $msg, false);
- } elseif ($already_sent) {
- $content .= '
- <span class="badge bg-success">' . $this->app->getDef('badge_transmitted') . '</span>
- <span class="text-success small">' . $this->app->getDef('text_transmitted_notice') . '</span>
- ';
- } elseif (!in_array($current_invoice_status_id, [EInvoiceService::STATUS_INVOICE, EInvoiceService::STATUS_CANCEL, EInvoiceService::STATUS_CREDIT_NOTE])) {
- $content .= '
- <span class="badge bg-warning text-dark">' . $this->app->getDef('badge_pending') . '</span>
- <span class="text-muted small">' . $this->app->getDef('text_pending_notice') . '</span>
- ';
- } else {
- if ($this->previousInvoiceStatus() === $new_invoice_status) {
- return false;
- }
- // Only process actionable statuses
- if (!in_array($new_invoice_status, [
- EInvoiceService::STATUS_INVOICE,
- EInvoiceService::STATUS_CANCEL,
- EInvoiceService::STATUS_CREDIT_NOTE,
- ])) {
- return false;