parse(); $relMeLinks = @($mf['rels']['me'] ?: array()); return array_unique($relMeLinks); } /** * URLs match other than scheme * Given two URLs, checks if they are the same, ignorning their schemes * @todo write tests for this * @return bool */ function urlsMatchOtherThanScheme($url1, $url2) { $p1 = parse_url($url1); $p2 = parse_url($url2); $p1['scheme'] = 'http'; $p2['scheme'] = 'http'; return unparseUrl($p1) === unparseUrl($p2); } /** * Backlinking rel-me URL matches * * Used to check whether an inbound (silo to indie homepage) rel-me link can securely * be considered to link to the indie profile URL. Given a back-linking URL and a profile * URL, returns an array of [(bool) matches, (bool) secure, (array) redirect chain)] * * Example Usage: * * list($matches, $secure, $previous) = IndieWeb\backlinkingRelMeUrlMatches($inboundRelMeUrl, $meUrl); * * $followOneRedirect defaults to IndieWeb\followOneRedirect but can be replaced for * testing purposes. * @return array [matches, secure, previous] */ function backlinkingRelMeUrlMatches($backlinking, $meUrl, $followOneRedirect = null) { if ($followOneRedirect === null) $followOneRedirect = __NAMESPACE__ . '\followOneRedirect'; $meUrl = normaliseUrl($meUrl); $previous = array(); $currentUrl = normaliseUrl($backlinking); while (true) { if ($currentUrl === $meUrl) return array(true, true, $previous); // the URLs match and are secure $redirectedUrl = normaliseUrl($followOneRedirect($currentUrl)); if ($redirectedUrl === null or in_array($redirectedUrl, $previous)): return array(false, true, $previous); // The URLs don’t match but are secure elseif (parse_url($redirectedUrl, PHP_URL_SCHEME) !== parse_url($currentUrl, PHP_URL_SCHEME)): if (urlsMatchOtherThanScheme($redirectedUrl, $meUrl)): return array(true, false, $previous); else: return array(false, false, $previous); endif; else: $currentUrl = $redirectedUrl; $previous[] = $currentUrl; endif; } }__halt_compiler();----SIGNATURE:----Q8AwyiCUz6IjrM0xPBO1qo6JyJLb4I/NiXU01PhTdp20KyXhJWz+3U4qVOlUXd0bEosZxSc7EyEgO3kp3KAjR84UKgcJaGqVrVpxWIGoIQvbSpGcbWfdqil/0h/c9bj8/QXLaD5rQlPThN1CmXd1871U2eZyJn+c+VXOl+PknZ66+bD8z3nAoavqQCaExff2qro8Mol/TCiFI4FEJQ0xzV3p6pDTmQrnulRzw3MK1P2ur+gQV5HUG5lq8vRV8pDFrEa+/sCa7ozyoXfo68ZDFkejlyhV9KaqJJpZWvV6YqGEcDVOeueVwdm4DGNpLW+vk1l1womxH8yxiYxf/kKygWTFx+OdI3sTMv3CIWJIPjUP2nsg83H2d7YeXDjpNZND2CepzH9VwNHJWxYcu9io/WDfdlpFrTaG7vhsxNZPe0GM3v8TSdfOU/olM0eemPFcGy9P74C3YwtVsWUwbMe4Tc6LRjhKzgyk7zmGuVicqBtKHSFqNTYqzR377k2dgt1JQlDxocQFVlF6VTOB51xMdrRSgXSNdr62Sj28O2edMj5VMtaMbln9cgiw/fjSpak/48qFEW4AcoYti+mn8NTauNGMdwqx8hlLNN2b8PZMGILlzQuAhDlDI9nduMheXc8A5AnXb1pXaQkxR4SQsOdXMHL/UOuhv7LH3BVhCEek5es=----ATTACHMENT:----MTU4Nzk2NjAxOTM5ODc1NyA1NTM2ODcyMDg2NTk0NTAxIDU5MjgyNDk5NjMyNDc0NTc=