%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom495844/wp-content/mu-plugins/vendor/wordpress/php-mcp-schema/src/Internal/
Upload File :
Create Path :
Current File : //dom495844/wp-content/mu-plugins/vendor/wordpress/php-mcp-schema/src/Internal/JsonDecoder.php

<?php

declare(strict_types=1);

namespace WP\McpSchema\Internal;

use WP\McpSchema\Exception\InvalidJsonException;

/**
 * Identity-preserving JSON decoder with lexical native-integer protection.
 *
 * @internal
 */
final class JsonDecoder
{
    public const MAX_DEPTH = InputNormalizer::MAX_DEPTH;

    private const MAX_DIAGNOSTIC_TOKEN_LENGTH = 80;

    /**
     * @return mixed
     */
    public function decode(string $json)
    {
        $this->assertNativeIntegers($json);

        try {
            return json_decode($json, false, self::MAX_DEPTH + 1, JSON_THROW_ON_ERROR);
        } catch (\JsonException $exception) {
            throw new InvalidJsonException('Invalid JSON: ' . $exception->getMessage(), 0, $exception);
        }
    }

    private function assertNativeIntegers(string $json): void
    {
        $length = strlen($json);
        $index  = 0;

        while ($index < $length) {
            $index += strcspn($json, '"-0123456789', $index);
            if ($index >= $length) {
                break;
            }

            if ($json[$index] === '"') {
                ++$index;
                while ($index < $length) {
                    $index += strcspn($json, '"\\', $index);
                    if ($index >= $length) {
                        break;
                    }
                    if ($json[$index] === '\\') {
                        $index += 2;
                        continue;
                    }
                    ++$index;
                    break;
                }
                continue;
            }

            if (! preg_match(
                '/\G-?(?:0|[1-9][0-9]*)(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?/',
                $json,
                $matches,
                0,
                $index
            )) {
                ++$index;
                continue;
            }

            $token = $matches[0];
            $index += strlen($token);
            if (strpos($token, '.') !== false || stripos($token, 'e') !== false) {
                if (! is_finite((float) $token)) {
                    throw new InvalidJsonException(sprintf(
                        'JSON number %s is outside the finite PHP number range.',
                        $this->diagnosticToken($token)
                    ));
                }
                continue;
            }

            if (! $this->isNativeInteger($token)) {
                throw new InvalidJsonException(sprintf(
                    'JSON integer %s exceeds the native PHP integer range.',
                    $this->diagnosticToken($token)
                ));
            }
        }
    }

    private function diagnosticToken(string $token): string
    {
        if (strlen($token) > self::MAX_DIAGNOSTIC_TOKEN_LENGTH) {
            $token = substr($token, 0, self::MAX_DIAGNOSTIC_TOKEN_LENGTH) . '...';
        }

        return addcslashes($token, "\0..\37\177..\377");
    }

    private function isNativeInteger(string $token): bool
    {
        $negative = $token[0] === '-';
        $digits   = ltrim($token, '-');
        $digits   = ltrim($digits, '0');
        if ($digits === '') {
            return true;
        }

        $limit = $negative ? ltrim((string) PHP_INT_MIN, '-') : (string) PHP_INT_MAX;
        if (strlen($digits) !== strlen($limit)) {
            return strlen($digits) < strlen($limit);
        }

        return strcmp($digits, $limit) <= 0;
    }
}

Zerion Mini Shell 1.0
Page not found - Broad Street Financial
[et_pb_section fb_built=”1″ theme_builder_area=”post_content” _builder_version=”4.20.0″ _module_preset=”default”][et_pb_row _builder_version=”4.20.0″ _module_preset=”default” theme_builder_area=”post_content”][et_pb_column _builder_version=”4.20.0″ _module_preset=”default” type=”4_4″ theme_builder_area=”post_content”][et_pb_text _builder_version=”4.20.0″ _module_preset=”default” theme_builder_area=”post_content” hover_enabled=”0″ sticky_enabled=”0″]

Page Not Found

Sorry the requested page you are looking for is missing or has been moved.

Please check out our site and see if you can find what you are looking for.

[/et_pb_text][/et_pb_column][/et_pb_row][/et_pb_section]