← All changes
|
vendor_prefixed/guzzlehttp/psr7/src/UriComparator.php
+9
-3
27.5
→
trunk
View file →
| @@ -16,9 +16,9 @@ | ||
| 16 | 16 | * respect to an original URL. |
| 17 | 17 | */ |
| 18 | 18 | public static function isCrossOrigin(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $original, \YoastSEO_Vendor\Psr\Http\Message\UriInterface $modified) : bool |
| 19 | 19 | { |
| 20 | - if (\strcasecmp($original->getHost(), $modified->getHost()) !== 0) { | |
| 20 | + if (!\YoastSEO_Vendor\GuzzleHttp\Psr7\Utils::caselessEquals($original->getHost(), $modified->getHost())) { | |
| 21 | 21 | return \true; |
| 22 | 22 | } |
| 23 | 23 | if ($original->getScheme() !== $modified->getScheme()) { |
| 24 | 24 | return \true; |
| @@ -27,15 +27,21 @@ | ||
| 27 | 27 | return \true; |
| 28 | 28 | } |
| 29 | 29 | return \false; |
| 30 | 30 | } |
| 31 | - private static function computePort(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri) : int | |
| 31 | + private static function computePort(\YoastSEO_Vendor\Psr\Http\Message\UriInterface $uri) : ?int | |
| 32 | 32 | { |
| 33 | 33 | $port = $uri->getPort(); |
| 34 | 34 | if (null !== $port) { |
| 35 | 35 | return $port; |
| 36 | 36 | } |
| 37 | - return 'https' === $uri->getScheme() ? 443 : 80; | |
| 37 | + if ('http' === $uri->getScheme()) { | |
| 38 | + return 80; | |
| 39 | + } | |
| 40 | + if ('https' === $uri->getScheme()) { | |
| 41 | + return 443; | |
| 42 | + } | |
| 43 | + return null; | |
| 38 | 44 | } |
| 39 | 45 | private function __construct() |
| 40 | 46 | { |
| 41 | 47 | // cannot be instantiated |