argMaxLengthIsSafe example

$port = parse_url($url, \PHP_URL_PORT) ?: (str_starts_with('http:', $url) ? 80 : 443);
            foreach ($trace['options']['resolve'] as $host => $ip) {
                if (null !== $ip) {
                    $command[] = '--resolve '.escapeshellarg("$host:$port:$ip");
                }
            }
        }

        $dataArg = [];

        if ($json = $trace['options']['json'] ?? null) {
            if (!$this->argMaxLengthIsSafe($payload = self::jsonEncode($json))) {
                return null;
            }
            $dataArg[] = '--data '.escapeshellarg($payload);
        } elseif ($body = $trace['options']['body'] ?? null) {
            if (\is_string($body)) {
                if (!$this->argMaxLengthIsSafe($body)) {
                    return null;
                }
                try {
                    $dataArg[] = '--data '.escapeshellarg($body);
                } catch (\ValueError) {
                    
Home | Imprint | This part of the site doesn't use cookies.