Файловый менеджер - Редактировать - /home/infrafs/INFRABIKEIT/wp-content/plugins/vendor.zip
Назад
PK �1\x��* �* true/punycode/src/Punycode.phpnu �[��� <?php namespace TrueBV; use TrueBV\Exception\DomainOutOfBoundsException; use TrueBV\Exception\LabelOutOfBoundsException; /** * Punycode implementation as described in RFC 3492 * * @link http://tools.ietf.org/html/rfc3492 */ class Punycode { /** * Bootstring parameter values * */ const BASE = 36; const TMIN = 1; const TMAX = 26; const SKEW = 38; const DAMP = 700; const INITIAL_BIAS = 72; const INITIAL_N = 128; const PREFIX = 'xn--'; const DELIMITER = '-'; /** * Encode table * * @param array */ protected static $encodeTable = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ); /** * Decode table * * @param array */ protected static $decodeTable = array( 'a' => 0, 'b' => 1, 'c' => 2, 'd' => 3, 'e' => 4, 'f' => 5, 'g' => 6, 'h' => 7, 'i' => 8, 'j' => 9, 'k' => 10, 'l' => 11, 'm' => 12, 'n' => 13, 'o' => 14, 'p' => 15, 'q' => 16, 'r' => 17, 's' => 18, 't' => 19, 'u' => 20, 'v' => 21, 'w' => 22, 'x' => 23, 'y' => 24, 'z' => 25, '0' => 26, '1' => 27, '2' => 28, '3' => 29, '4' => 30, '5' => 31, '6' => 32, '7' => 33, '8' => 34, '9' => 35 ); /** * Character encoding * * @param string */ protected $encoding; /** * Constructor * * @param string $encoding Character encoding */ public function __construct($encoding = 'UTF-8') { $this->encoding = $encoding; } /** * Encode a domain to its Punycode version * * @param string $input Domain name in Unicode to be encoded * @return string Punycode representation in ASCII */ public function encode($input) { $input = mb_strtolower($input, $this->encoding); $parts = explode('.', $input); foreach ($parts as &$part) { $length = strlen($part); if ($length < 1) { throw new LabelOutOfBoundsException(sprintf('The length of any one label is limited to between 1 and 63 octets, but %s given.', $length)); } $part = $this->encodePart($part); } $output = implode('.', $parts); $length = strlen($output); if ($length > 255) { throw new DomainOutOfBoundsException(sprintf('A full domain name is limited to 255 octets (including the separators), %s given.', $length)); } return $output; } /** * Encode a part of a domain name, such as tld, to its Punycode version * * @param string $input Part of a domain name * @return string Punycode representation of a domain part */ protected function encodePart($input) { $codePoints = $this->listCodePoints($input); $n = static::INITIAL_N; $bias = static::INITIAL_BIAS; $delta = 0; $h = $b = count($codePoints['basic']); $output = ''; foreach ($codePoints['basic'] as $code) { $output .= $this->codePointToChar($code); } if ($input === $output) { return $output; } if ($b > 0) { $output .= static::DELIMITER; } $codePoints['nonBasic'] = array_unique($codePoints['nonBasic']); sort($codePoints['nonBasic']); $i = 0; $length = mb_strlen($input, $this->encoding); while ($h < $length) { $m = $codePoints['nonBasic'][$i++]; $delta = $delta + ($m - $n) * ($h + 1); $n = $m; foreach ($codePoints['all'] as $c) { if ($c < $n || $c < static::INITIAL_N) { $delta++; } if ($c === $n) { $q = $delta; for ($k = static::BASE;; $k += static::BASE) { $t = $this->calculateThreshold($k, $bias); if ($q < $t) { break; } $code = $t + (($q - $t) % (static::BASE - $t)); $output .= static::$encodeTable[$code]; $q = ($q - $t) / (static::BASE - $t); } $output .= static::$encodeTable[$q]; $bias = $this->adapt($delta, $h + 1, ($h === $b)); $delta = 0; $h++; } } $delta++; $n++; } $out = static::PREFIX . $output; $length = strlen($out); if ($length > 63 || $length < 1) { throw new LabelOutOfBoundsException(sprintf('The length of any one label is limited to between 1 and 63 octets, but %s given.', $length)); } return $out; } /** * Decode a Punycode domain name to its Unicode counterpart * * @param string $input Domain name in Punycode * @return string Unicode domain name */ public function decode($input) { $input = strtolower($input); $parts = explode('.', $input); foreach ($parts as &$part) { $length = strlen($part); if ($length > 63 || $length < 1) { throw new LabelOutOfBoundsException(sprintf('The length of any one label is limited to between 1 and 63 octets, but %s given.', $length)); } if (strpos($part, static::PREFIX) !== 0) { continue; } $part = substr($part, strlen(static::PREFIX)); $part = $this->decodePart($part); } $output = implode('.', $parts); $length = strlen($output); if ($length > 255) { throw new DomainOutOfBoundsException(sprintf('A full domain name is limited to 255 octets (including the separators), %s given.', $length)); } return $output; } /** * Decode a part of domain name, such as tld * * @param string $input Part of a domain name * @return string Unicode domain part */ protected function decodePart($input) { $n = static::INITIAL_N; $i = 0; $bias = static::INITIAL_BIAS; $output = ''; $pos = strrpos($input, static::DELIMITER); if ($pos !== false) { $output = substr($input, 0, $pos++); } else { $pos = 0; } $outputLength = strlen($output); $inputLength = strlen($input); while ($pos < $inputLength) { $oldi = $i; $w = 1; for ($k = static::BASE;; $k += static::BASE) { $digit = static::$decodeTable[$input[$pos++]]; $i = $i + ($digit * $w); $t = $this->calculateThreshold($k, $bias); if ($digit < $t) { break; } $w = $w * (static::BASE - $t); } $bias = $this->adapt($i - $oldi, ++$outputLength, ($oldi === 0)); $n = $n + (int) ($i / $outputLength); $i = $i % ($outputLength); $output = mb_substr($output, 0, $i, $this->encoding) . $this->codePointToChar($n) . mb_substr($output, $i, $outputLength - 1, $this->encoding); $i++; } return $output; } /** * Calculate the bias threshold to fall between TMIN and TMAX * * @param integer $k * @param integer $bias * @return integer */ protected function calculateThreshold($k, $bias) { if ($k <= $bias + static::TMIN) { return static::TMIN; } elseif ($k >= $bias + static::TMAX) { return static::TMAX; } return $k - $bias; } /** * Bias adaptation * * @param integer $delta * @param integer $numPoints * @param boolean $firstTime * @return integer */ protected function adapt($delta, $numPoints, $firstTime) { $delta = (int) ( ($firstTime) ? $delta / static::DAMP : $delta / 2 ); $delta += (int) ($delta / $numPoints); $k = 0; while ($delta > ((static::BASE - static::TMIN) * static::TMAX) / 2) { $delta = (int) ($delta / (static::BASE - static::TMIN)); $k = $k + static::BASE; } $k = $k + (int) (((static::BASE - static::TMIN + 1) * $delta) / ($delta + static::SKEW)); return $k; } /** * List code points for a given input * * @param string $input * @return array Multi-dimension array with basic, non-basic and aggregated code points */ protected function listCodePoints($input) { $codePoints = array( 'all' => array(), 'basic' => array(), 'nonBasic' => array(), ); $length = mb_strlen($input, $this->encoding); for ($i = 0; $i < $length; $i++) { $char = mb_substr($input, $i, 1, $this->encoding); $code = $this->charToCodePoint($char); if ($code < 128) { $codePoints['all'][] = $codePoints['basic'][] = $code; } else { $codePoints['all'][] = $codePoints['nonBasic'][] = $code; } } return $codePoints; } /** * Convert a single or multi-byte character to its code point * * @param string $char * @return integer */ protected function charToCodePoint($char) { $code = ord($char[0]); if ($code < 128) { return $code; } elseif ($code < 224) { return (($code - 192) * 64) + (ord($char[1]) - 128); } elseif ($code < 240) { return (($code - 224) * 4096) + ((ord($char[1]) - 128) * 64) + (ord($char[2]) - 128); } else { return (($code - 240) * 262144) + ((ord($char[1]) - 128) * 4096) + ((ord($char[2]) - 128) * 64) + (ord($char[3]) - 128); } } /** * Convert a code point to its single or multi-byte character * * @param integer $code * @return string */ protected function codePointToChar($code) { if ($code <= 0x7F) { return chr($code); } elseif ($code <= 0x7FF) { return chr(($code >> 6) + 192) . chr(($code & 63) + 128); } elseif ($code <= 0xFFFF) { return chr(($code >> 12) + 224) . chr((($code >> 6) & 63) + 128) . chr(($code & 63) + 128); } else { return chr(($code >> 18) + 240) . chr((($code >> 12) & 63) + 128) . chr((($code >> 6) & 63) + 128) . chr(($code & 63) + 128); } } } PK �1\�R�u� � 9 true/punycode/src/Exception/LabelOutOfBoundsException.phpnu �[��� <?php namespace TrueBV\Exception; /** * Class LabelOutOfBoundsException * @package TrueBV\Exception * @author Sebastian Kroczek <sk@xbug.de> */ class LabelOutOfBoundsException extends OutOfBoundsException { } PK �1\�}�� � 4 true/punycode/src/Exception/OutOfBoundsException.phpnu �[��� <?php namespace TrueBV\Exception; /** * Class OutOfBoundsException * @package TrueBV\Exception * @author Sebastian Kroczek <sk@xbug.de> */ class OutOfBoundsException extends \RuntimeException { } PK �1\� w�� � : true/punycode/src/Exception/DomainOutOfBoundsException.phpnu �[��� <?php namespace TrueBV\Exception; /** * Class DomainOutOfBoundsException * @package TrueBV\Exception * @author Sebastian Kroczek <sk@xbug.de> */ class DomainOutOfBoundsException extends OutOfBoundsException { } PK �1\�gڍ" " true/punycode/LICENSEnu �[��� Copyright (c) 2014 TrueServer B.V. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.PK �1\~�Ʊ�X �X symfony/polyfill-iconv/Iconv.phpnu �[��� <?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Polyfill\Iconv; /** * iconv implementation in pure PHP, UTF-8 centric. * * Implemented: * - iconv - Convert string to requested character encoding * - iconv_mime_decode - Decodes a MIME header field * - iconv_mime_decode_headers - Decodes multiple MIME header fields at once * - iconv_get_encoding - Retrieve internal configuration variables of iconv extension * - iconv_set_encoding - Set current setting for character encoding conversion * - iconv_mime_encode - Composes a MIME header field * - iconv_strlen - Returns the character count of string * - iconv_strpos - Finds position of first occurrence of a needle within a haystack * - iconv_strrpos - Finds the last occurrence of a needle within a haystack * - iconv_substr - Cut out part of a string * * Charsets available for conversion are defined by files * in the charset/ directory and by Iconv::$alias below. * You're welcome to send back any addition you make. * * @author Nicolas Grekas <p@tchwork.com> * * @internal */ final class Iconv { const ERROR_ILLEGAL_CHARACTER = 'iconv(): Detected an illegal character in input string'; const ERROR_WRONG_CHARSET = 'iconv(): Wrong charset, conversion from `%s\' to `%s\' is not allowed'; public static $inputEncoding = 'utf-8'; public static $outputEncoding = 'utf-8'; public static $internalEncoding = 'utf-8'; private static $alias = array( 'utf8' => 'utf-8', 'ascii' => 'us-ascii', 'tis-620' => 'iso-8859-11', 'cp1250' => 'windows-1250', 'cp1251' => 'windows-1251', 'cp1252' => 'windows-1252', 'cp1253' => 'windows-1253', 'cp1254' => 'windows-1254', 'cp1255' => 'windows-1255', 'cp1256' => 'windows-1256', 'cp1257' => 'windows-1257', 'cp1258' => 'windows-1258', 'shift-jis' => 'cp932', 'shift_jis' => 'cp932', 'latin1' => 'iso-8859-1', 'latin2' => 'iso-8859-2', 'latin3' => 'iso-8859-3', 'latin4' => 'iso-8859-4', 'latin5' => 'iso-8859-9', 'latin6' => 'iso-8859-10', 'latin7' => 'iso-8859-13', 'latin8' => 'iso-8859-14', 'latin9' => 'iso-8859-15', 'latin10' => 'iso-8859-16', 'iso8859-1' => 'iso-8859-1', 'iso8859-2' => 'iso-8859-2', 'iso8859-3' => 'iso-8859-3', 'iso8859-4' => 'iso-8859-4', 'iso8859-5' => 'iso-8859-5', 'iso8859-6' => 'iso-8859-6', 'iso8859-7' => 'iso-8859-7', 'iso8859-8' => 'iso-8859-8', 'iso8859-9' => 'iso-8859-9', 'iso8859-10' => 'iso-8859-10', 'iso8859-11' => 'iso-8859-11', 'iso8859-12' => 'iso-8859-12', 'iso8859-13' => 'iso-8859-13', 'iso8859-14' => 'iso-8859-14', 'iso8859-15' => 'iso-8859-15', 'iso8859-16' => 'iso-8859-16', 'iso_8859-1' => 'iso-8859-1', 'iso_8859-2' => 'iso-8859-2', 'iso_8859-3' => 'iso-8859-3', 'iso_8859-4' => 'iso-8859-4', 'iso_8859-5' => 'iso-8859-5', 'iso_8859-6' => 'iso-8859-6', 'iso_8859-7' => 'iso-8859-7', 'iso_8859-8' => 'iso-8859-8', 'iso_8859-9' => 'iso-8859-9', 'iso_8859-10' => 'iso-8859-10', 'iso_8859-11' => 'iso-8859-11', 'iso_8859-12' => 'iso-8859-12', 'iso_8859-13' => 'iso-8859-13', 'iso_8859-14' => 'iso-8859-14', 'iso_8859-15' => 'iso-8859-15', 'iso_8859-16' => 'iso-8859-16', 'iso88591' => 'iso-8859-1', 'iso88592' => 'iso-8859-2', 'iso88593' => 'iso-8859-3', 'iso88594' => 'iso-8859-4', 'iso88595' => 'iso-8859-5', 'iso88596' => 'iso-8859-6', 'iso88597' => 'iso-8859-7', 'iso88598' => 'iso-8859-8', 'iso88599' => 'iso-8859-9', 'iso885910' => 'iso-8859-10', 'iso885911' => 'iso-8859-11', 'iso885912' => 'iso-8859-12', 'iso885913' => 'iso-8859-13', 'iso885914' => 'iso-8859-14', 'iso885915' => 'iso-8859-15', 'iso885916' => 'iso-8859-16', ); private static $translitMap = array(); private static $convertMap = array(); private static $errorHandler; private static $lastError; private static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); private static $isValidUtf8; public static function iconv($inCharset, $outCharset, $str) { $str = (string) $str; if ('' === $str) { return ''; } // Prepare for //IGNORE and //TRANSLIT $translit = $ignore = ''; $outCharset = strtolower($outCharset); $inCharset = strtolower($inCharset); if ('' === $outCharset) { $outCharset = 'iso-8859-1'; } if ('' === $inCharset) { $inCharset = 'iso-8859-1'; } do { $loop = false; if ('//translit' === substr($outCharset, -10)) { $loop = $translit = true; $outCharset = substr($outCharset, 0, -10); } if ('//ignore' === substr($outCharset, -8)) { $loop = $ignore = true; $outCharset = substr($outCharset, 0, -8); } } while ($loop); do { $loop = false; if ('//translit' === substr($inCharset, -10)) { $loop = true; $inCharset = substr($inCharset, 0, -10); } if ('//ignore' === substr($inCharset, -8)) { $loop = true; $inCharset = substr($inCharset, 0, -8); } } while ($loop); if (isset(self::$alias[$inCharset])) { $inCharset = self::$alias[$inCharset]; } if (isset(self::$alias[$outCharset])) { $outCharset = self::$alias[$outCharset]; } // Load charset maps if (('utf-8' !== $inCharset && !self::loadMap('from.', $inCharset, $inMap)) || ('utf-8' !== $outCharset && !self::loadMap('to.', $outCharset, $outMap))) { trigger_error(sprintf(self::ERROR_WRONG_CHARSET, $inCharset, $outCharset)); return false; } if ('utf-8' !== $inCharset) { // Convert input to UTF-8 $result = ''; if (self::mapToUtf8($result, $inMap, $str, $ignore)) { $str = $result; } else { $str = false; } self::$isValidUtf8 = true; } else { self::$isValidUtf8 = preg_match('//u', $str); if (!self::$isValidUtf8 && !$ignore) { trigger_error(self::ERROR_ILLEGAL_CHARACTER); return false; } if ('utf-8' === $outCharset) { // UTF-8 validation $str = self::utf8ToUtf8($str, $ignore); } } if ('utf-8' !== $outCharset && false !== $str) { // Convert output to UTF-8 $result = ''; if (self::mapFromUtf8($result, $outMap, $str, $ignore, $translit)) { return $result; } return false; } return $str; } public static function iconv_mime_decode_headers($str, $mode = 0, $charset = null) { if (null === $charset) { $charset = self::$internalEncoding; } if (false !== strpos($str, "\r")) { $str = strtr(str_replace("\r\n", "\n", $str), "\r", "\n"); } $str = explode("\n\n", $str, 2); $headers = array(); $str = preg_split('/\n(?![ \t])/', $str[0]); foreach ($str as $str) { $str = self::iconv_mime_decode($str, $mode, $charset); if (false === $str) { return false; } $str = explode(':', $str, 2); if (2 === \count($str)) { if (isset($headers[$str[0]])) { if (!\is_array($headers[$str[0]])) { $headers[$str[0]] = array($headers[$str[0]]); } $headers[$str[0]][] = ltrim($str[1]); } else { $headers[$str[0]] = ltrim($str[1]); } } } return $headers; } public static function iconv_mime_decode($str, $mode = 0, $charset = null) { if (null === $charset) { $charset = self::$internalEncoding; } if (ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) { $charset .= '//IGNORE'; } if (false !== strpos($str, "\r")) { $str = strtr(str_replace("\r\n", "\n", $str), "\r", "\n"); } $str = preg_split('/\n(?![ \t])/', rtrim($str), 2); $str = preg_replace('/[ \t]*\n[ \t]+/', ' ', rtrim($str[0])); $str = preg_split('/=\?([^?]+)\?([bqBQ])\?(.*?)\?=/', $str, -1, PREG_SPLIT_DELIM_CAPTURE); $result = self::iconv('utf-8', $charset, $str[0]); if (false === $result) { return false; } $i = 1; $len = \count($str); while ($i < $len) { $c = strtolower($str[$i]); if ((ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) && 'utf-8' !== $c && !isset(self::$alias[$c]) && !self::loadMap('from.', $c, $d)) { $d = false; } elseif ('B' === strtoupper($str[$i + 1])) { $d = base64_decode($str[$i + 2]); } else { $d = rawurldecode(strtr(str_replace('%', '%25', $str[$i + 2]), '=_', '% ')); } if (false !== $d) { if ('' !== $d) { if ('' === $d = self::iconv($c, $charset, $d)) { $str[$i + 3] = substr($str[$i + 3], 1); } else { $result .= $d; } } $d = self::iconv('utf-8', $charset, $str[$i + 3]); if ('' !== trim($d)) { $result .= $d; } } elseif (ICONV_MIME_DECODE_CONTINUE_ON_ERROR & $mode) { $result .= "=?{$str[$i]}?{$str[$i + 1]}?{$str[$i + 2]}?={$str[$i + 3]}"; } else { $result = false; break; } $i += 4; } return $result; } public static function iconv_get_encoding($type = 'all') { switch ($type) { case 'input_encoding': return self::$inputEncoding; case 'output_encoding': return self::$outputEncoding; case 'internal_encoding': return self::$internalEncoding; } return array( 'input_encoding' => self::$inputEncoding, 'output_encoding' => self::$outputEncoding, 'internal_encoding' => self::$internalEncoding, ); } public static function iconv_set_encoding($type, $charset) { switch ($type) { case 'input_encoding': self::$inputEncoding = $charset; break; case 'output_encoding': self::$outputEncoding = $charset; break; case 'internal_encoding': self::$internalEncoding = $charset; break; default: return false; } return true; } public static function iconv_mime_encode($fieldName, $fieldValue, $pref = null) { if (!\is_array($pref)) { $pref = array(); } $pref += array( 'scheme' => 'B', 'input-charset' => self::$internalEncoding, 'output-charset' => self::$internalEncoding, 'line-length' => 76, 'line-break-chars' => "\r\n", ); if (preg_match('/[\x80-\xFF]/', $fieldName)) { $fieldName = ''; } $scheme = strtoupper(substr($pref['scheme'], 0, 1)); $in = strtolower($pref['input-charset']); $out = strtolower($pref['output-charset']); if ('utf-8' !== $in && false === $fieldValue = self::iconv($in, 'utf-8', $fieldValue)) { return false; } preg_match_all('/./us', $fieldValue, $chars); $chars = isset($chars[0]) ? $chars[0] : array(); $lineBreak = (int) $pref['line-length']; $lineStart = "=?{$pref['output-charset']}?{$scheme}?"; $lineLength = \strlen($fieldName) + 2 + \strlen($lineStart) + 2; $lineOffset = \strlen($lineStart) + 3; $lineData = ''; $fieldValue = array(); $Q = 'Q' === $scheme; foreach ($chars as $c) { if ('utf-8' !== $out && false === $c = self::iconv('utf-8', $out, $c)) { return false; } $o = $Q ? $c = preg_replace_callback( '/[=_\?\x00-\x1F\x80-\xFF]/', array(__CLASS__, 'qpByteCallback'), $c ) : base64_encode($lineData.$c); if (isset($o[$lineBreak - $lineLength])) { if (!$Q) { $lineData = base64_encode($lineData); } $fieldValue[] = $lineStart.$lineData.'?='; $lineLength = $lineOffset; $lineData = ''; } $lineData .= $c; $Q && $lineLength += \strlen($c); } if ('' !== $lineData) { if (!$Q) { $lineData = base64_encode($lineData); } $fieldValue[] = $lineStart.$lineData.'?='; } return $fieldName.': '.implode($pref['line-break-chars'].' ', $fieldValue); } public static function iconv_strlen($s, $encoding = null) { static $hasXml = null; if (null === $hasXml) { $hasXml = \extension_loaded('xml'); } if ($hasXml) { return self::strlen1($s, $encoding); } return self::strlen2($s, $encoding); } public static function strlen1($s, $encoding = null) { if (null === $encoding) { $encoding = self::$internalEncoding; } if (0 !== stripos($encoding, 'utf-8') && false === $s = self::iconv($encoding, 'utf-8', $s)) { return false; } return \strlen(utf8_decode($s)); } public static function strlen2($s, $encoding = null) { if (null === $encoding) { $encoding = self::$internalEncoding; } if (0 !== stripos($encoding, 'utf-8') && false === $s = self::iconv($encoding, 'utf-8', $s)) { return false; } $ulenMask = self::$ulenMask; $i = 0; $j = 0; $len = \strlen($s); while ($i < $len) { $u = $s[$i] & "\xF0"; $i += isset($ulenMask[$u]) ? $ulenMask[$u] : 1; ++$j; } return $j; } public static function iconv_strpos($haystack, $needle, $offset = 0, $encoding = null) { if (null === $encoding) { $encoding = self::$internalEncoding; } if (0 !== stripos($encoding, 'utf-8')) { if (false === $haystack = self::iconv($encoding, 'utf-8', $haystack)) { return false; } if (false === $needle = self::iconv($encoding, 'utf-8', $needle)) { return false; } } if ($offset = (int) $offset) { $haystack = self::iconv_substr($haystack, $offset, 2147483647, 'utf-8'); } $pos = strpos($haystack, $needle); return false === $pos ? false : ($offset + ($pos ? self::iconv_strlen(substr($haystack, 0, $pos), 'utf-8') : 0)); } public static function iconv_strrpos($haystack, $needle, $encoding = null) { if (null === $encoding) { $encoding = self::$internalEncoding; } if (0 !== stripos($encoding, 'utf-8')) { if (false === $haystack = self::iconv($encoding, 'utf-8', $haystack)) { return false; } if (false === $needle = self::iconv($encoding, 'utf-8', $needle)) { return false; } } $pos = isset($needle[0]) ? strrpos($haystack, $needle) : false; return false === $pos ? false : self::iconv_strlen($pos ? substr($haystack, 0, $pos) : $haystack, 'utf-8'); } public static function iconv_substr($s, $start, $length = 2147483647, $encoding = null) { if (null === $encoding) { $encoding = self::$internalEncoding; } if (0 !== stripos($encoding, 'utf-8')) { $encoding = null; } elseif (false === $s = self::iconv($encoding, 'utf-8', $s)) { return false; } $s = (string) $s; $slen = self::iconv_strlen($s, 'utf-8'); $start = (int) $start; if (0 > $start) { $start += $slen; } if (0 > $start) { return false; } if ($start >= $slen) { return false; } $rx = $slen - $start; if (0 > $length) { $length += $rx; } if (0 === $length) { return ''; } if (0 > $length) { return false; } if ($length > $rx) { $length = $rx; } $rx = '/^'.($start ? self::pregOffset($start) : '').'('.self::pregOffset($length).')/u'; $s = preg_match($rx, $s, $s) ? $s[1] : ''; if (null === $encoding) { return $s; } return self::iconv('utf-8', $encoding, $s); } private static function loadMap($type, $charset, &$map) { if (!isset(self::$convertMap[$type.$charset])) { if (false === $map = self::getData($type.$charset)) { if ('to.' === $type && self::loadMap('from.', $charset, $map)) { $map = array_flip($map); } else { return false; } } self::$convertMap[$type.$charset] = $map; } else { $map = self::$convertMap[$type.$charset]; } return true; } private static function utf8ToUtf8($str, $ignore) { $ulenMask = self::$ulenMask; $valid = self::$isValidUtf8; $u = $str; $i = $j = 0; $len = \strlen($str); while ($i < $len) { if ($str[$i] < "\x80") { $u[$j++] = $str[$i++]; } else { $ulen = $str[$i] & "\xF0"; $ulen = isset($ulenMask[$ulen]) ? $ulenMask[$ulen] : 1; $uchr = substr($str, $i, $ulen); if (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr))) { if ($ignore) { ++$i; continue; } trigger_error(self::ERROR_ILLEGAL_CHARACTER); return false; } else { $i += $ulen; } $u[$j++] = $uchr[0]; isset($uchr[1]) && 0 !== ($u[$j++] = $uchr[1]) && isset($uchr[2]) && 0 !== ($u[$j++] = $uchr[2]) && isset($uchr[3]) && 0 !== ($u[$j++] = $uchr[3]); } } return substr($u, 0, $j); } private static function mapToUtf8(&$result, array $map, $str, $ignore) { $len = \strlen($str); for ($i = 0; $i < $len; ++$i) { if (isset($str[$i + 1], $map[$str[$i].$str[$i + 1]])) { $result .= $map[$str[$i].$str[++$i]]; } elseif (isset($map[$str[$i]])) { $result .= $map[$str[$i]]; } elseif (!$ignore) { trigger_error(self::ERROR_ILLEGAL_CHARACTER); return false; } } return true; } private static function mapFromUtf8(&$result, array $map, $str, $ignore, $translit) { $ulenMask = self::$ulenMask; $valid = self::$isValidUtf8; if ($translit && !self::$translitMap) { self::$translitMap = self::getData('translit'); } $i = 0; $len = \strlen($str); while ($i < $len) { if ($str[$i] < "\x80") { $uchr = $str[$i++]; } else { $ulen = $str[$i] & "\xF0"; $ulen = isset($ulenMask[$ulen]) ? $ulenMask[$ulen] : 1; $uchr = substr($str, $i, $ulen); if ($ignore && (1 === $ulen || !($valid || preg_match('/^.$/us', $uchr)))) { ++$i; continue; } else { $i += $ulen; } } if (isset($map[$uchr])) { $result .= $map[$uchr]; } elseif ($translit) { if (isset(self::$translitMap[$uchr])) { $uchr = self::$translitMap[$uchr]; } elseif ($uchr >= "\xC3\x80") { $uchr = \Normalizer::normalize($uchr, \Normalizer::NFD); if ($uchr[0] < "\x80") { $uchr = $uchr[0]; } elseif ($ignore) { continue; } else { return false; } } elseif ($ignore) { continue; } else { return false; } $str = $uchr.substr($str, $i); $len = \strlen($str); $i = 0; } elseif (!$ignore) { return false; } } return true; } private static function qpByteCallback(array $m) { return '='.strtoupper(dechex(\ord($m[0]))); } private static function pregOffset($offset) { $rx = array(); $offset = (int) $offset; while ($offset > 65535) { $rx[] = '.{65535}'; $offset -= 65535; } return implode('', $rx).'.{'.$offset.'}'; } private static function getData($file) { if (file_exists($file = __DIR__.'/Resources/charset/'.$file.'.php')) { return require $file; } return false; } } PK �1\�\�) ) symfony/polyfill-iconv/LICENSEnu �[��� Copyright (c) 2015-2019 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK �1\s1 �� � 7 symfony/polyfill-iconv/Resources/charset/from.cp037.phpnu �[��� <?php static $data = array ( '