Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Idn.php

function Idn::lookupCodePointStatus

Parameters

int $codePoint:

bool $useSTD3ASCIIRules:

Return value

array{status: string, mapping?: string}

2 calls to Idn::lookupCodePointStatus()
Idn::mapCodePoints in vendor/symfony/polyfill-intl-idn/Idn.php
Idn::validateLabel in vendor/symfony/polyfill-intl-idn/Idn.php

File

vendor/symfony/polyfill-intl-idn/Idn.php, line 887

Class

Idn
@internal

Namespace

Symfony\Polyfill\Intl\Idn

Code

private static function lookupCodePointStatus($codePoint, $useSTD3ASCIIRules) {
    if (!self::$mappingTableLoaded) {
        self::$mappingTableLoaded = true;
        self::$mapped = (require __DIR__ . '/Resources/unidata/mapped.php');
        self::$ignored = (require __DIR__ . '/Resources/unidata/ignored.php');
        self::$deviation = (require __DIR__ . '/Resources/unidata/deviation.php');
        self::$disallowed = (require __DIR__ . '/Resources/unidata/disallowed.php');
        self::$disallowed_STD3_mapped = (require __DIR__ . '/Resources/unidata/disallowed_STD3_mapped.php');
        self::$disallowed_STD3_valid = (require __DIR__ . '/Resources/unidata/disallowed_STD3_valid.php');
    }
    if (isset(self::$mapped[$codePoint])) {
        return [
            'status' => 'mapped',
            'mapping' => self::$mapped[$codePoint],
        ];
    }
    if (isset(self::$ignored[$codePoint])) {
        return [
            'status' => 'ignored',
        ];
    }
    if (isset(self::$deviation[$codePoint])) {
        return [
            'status' => 'deviation',
            'mapping' => self::$deviation[$codePoint],
        ];
    }
    if (isset(self::$disallowed[$codePoint]) || DisallowedRanges::inRange($codePoint)) {
        return [
            'status' => 'disallowed',
        ];
    }
    $isDisallowedMapped = isset(self::$disallowed_STD3_mapped[$codePoint]);
    if ($isDisallowedMapped || isset(self::$disallowed_STD3_valid[$codePoint])) {
        $status = 'disallowed';
        if (!$useSTD3ASCIIRules) {
            $status = $isDisallowedMapped ? 'mapped' : 'valid';
        }
        if ($isDisallowedMapped) {
            return [
                'status' => $status,
                'mapping' => self::$disallowed_STD3_mapped[$codePoint],
            ];
        }
        return [
            'status' => $status,
        ];
    }
    return [
        'status' => 'valid',
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal