getPath() === '' && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') ) { $uri = $uri->withPath('/'); } if ($flags & self::REMOVE_DEFAULT_HOST && $uri->getScheme() === 'file' && $uri->getHost() === 'localhost') { $uri = $uri->withHost(''); } if ($flags & self::REMOVE_DEFAULT_PORT && $uri->getPort() !== null && Uri::isDefaultPort($uri)) { $uri = $uri->withPort(null); } if ($flags & self::REMOVE_DOT_SEGMENTS && !Uri::isRelativePathReference($uri)) { $uri = $uri->withPath(UriResolver::removeDotSegments($uri->getPath())); } if ($flags & self::REMOVE_DUPLICATE_SLASHES) { $uri = $uri->withPath(preg_replace('#//++#', '/', $uri->getPath())); } if ($flags & self::SORT_QUERY_PARAMETERS && $uri->getQuery() !== '') { $queryKeyValues = explode('&', $uri->getQuery()); sort($queryKeyValues); $uri = $uri->withQuery(implode('&', $queryKeyValues)); } return $uri; } /** * Whether two URIs can be considered equivalent. * * Both URIs are normalized automatically before comparison with the given $normalizations bitmask. The method also * accepts relative URI references and returns true when they are equivalent. This of course assumes they will be * resolved against the same base URI. If this is not the case, determination of equivalence or difference of * relative references does not mean anything. * * @param UriInterface $uri1 An URI to compare * @param UriInterface $uri2 An URI to compare * @param int $normalizations A bitmask of normalizations to apply, see constants * * @return bool * * @link https://tools.ietf.org/html/rfc3986#section-6.1 */ public static function isEquivalent( UriInterface $uri1, UriInterface $uri2, $normalizations = self::PRESERVING_NORMALIZATIONS, ) { return (string) self::normalize($uri1, $normalizations) === (string) self::normalize($uri2, $normalizations); } private static function capitalizePercentEncoding(UriInterface $uri) { $regex = '/(?:%[A-Fa-f0-9]{2})++/'; $callback = function (array $match) { return strtoupper($match[0]); }; return $uri->withPath( preg_replace_callback($regex, $callback, $uri->getPath()) )->withQuery( preg_replace_callback($regex, $callback, $uri->getQuery()) ); } private static function decodeUnreservedCharacters(UriInterface $uri) { $regex = '/%(?:2D|2E|5F|7E|3[0-9]|[46][1-9A-F]|[57][0-9A])/i'; $callback = function (array $match) { return rawurldecode($match[0]); }; return $uri->withPath( preg_replace_callback($regex, $callback, $uri->getPath()) )->withQuery( preg_replace_callback($regex, $callback, $uri->getQuery()) ); } private function __construct() { // cannot be instantiated } }__halt_compiler();----SIGNATURE:----FsE+hEIJRRgkWLpmdFm8AN3+3bmugB0wIpeBCqslOOpyBwzcLoDsaEQnwsoEIwpM08glM6vGZAOXN3H0zDe62aGuuGiT8nAUMmuAMiUljLno+4Jr9M5Wqqbd+8mYZ6cCobgyFxl6ofLPhybVIiY6HxPOsnzPhWUC4rG93GvgX6PEmfAS6sCoxQMJf7STFDB42sESINogz5vxKhvsZZLd8kUz0DRcO6TkXx/o1CR3AQnSHVFXHZqSHHdMWMGTuVNYz2ckEj5fzm+wC1XvHfXJ62iqYDcQHwDoFq1HHqjCVlo8sXH7b7/Fv0xGaGe6QlSEeVLw7FcercabXiiLSJ1E7fg9Ua4bi0Wf/8qJQ96nLKakZm2uJicYNtQODJK/cAmXQTmQbu36sYAfMv3DqWX0SYXAXNXxu8aVetm0leqSNen910Bv71Qb3vfwR1GsPHQmTlrfMH6iXPoEZZHrrhxhW9+GfXebGLtdlIqiuORipuNq0q1p4TWtrsMPPkFwqdk1aEkWRR6ad/8QBTgUuo5G3B7KhPRgE1Fe/EOLTg6QxYgnDq3xkujD/DrHbnAkRsXeIUALKC8CQZAzIW/0Fbgns5GHsmkP+yopUNkcPcRiwrzudQMW6aVjn+f3u2W2vrF85izK/QPZkOEz4Vo1CKpUnj9VG2wQksi3XAKchBpi0Ww=----ATTACHMENT:----ODkyNjcyOTE5ODExNTE4OSAyNzM5NTEwNTI2NTYyNzcgNTY0NzA2NDU1OTcwNDA2NQ==