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:----d3EpcZAbvN+F3VDpw/0xafB28KvsRxXltSWt+eaqrkZ9Sw0AeDFlFrKsCztEGQsvmmgm8topbVFXn42Tv98NS9hI1vF77otG4yzZRisyPKOoSRwO2nQF2/GzaplrGWrcuG3sCRtJGm1UPLtoP8km5tYG8ju1LD81s1LV4huDYWy8U9RBUeiRTlC1H3D/wPSnJlevSYaXN8HwHW7B8CjcT3IECMgsZaXFGujoVVjsZMx+poEfUGLk/JYlsdm/V8PnzSiGD+gASS9ikBAKS1mQ6EIHBzRH+CfmxtATs+C5QyxaGwOKUvQwVCibNg2ZZBMQ7aAx4pL9Vxp0jddIug7khzsRB4zG4M1p8Z5i1ubMAAZhPzgy1K6fypEB7UEejkrUeavZLbVhHAsTJxYh0sxnUwHSY4+4VGLhwDsCRiU0OQ+5FREkzPfMJ0jGd94SyLqMFHR5Lm10Ue6ZupSf352QjP9jETGaL70Gg0rpvgVqJ6bHCHNVi67Ra83UPoxOGUqBd87yr2Zgg5IpO0usSq4NE9kZQS0tJQcz1weiheOscXeHSwcYPHWXrPmvZx5IdvX481L64ek5sWv0aOUo35B9GzUrCACkxG4llDW8YXZ9d48eXGuC40q5M8a3hqPT6aXbO2wYubWosrXAB60fVRG94TJOYhdinhQvZ6yt8BnzQUk=----ATTACHMENT:----MjM0ODA5NzQyNzczMjYxMiAzOTU0NTg1MDA1Mzg4OTQgNTg2NTYzOTg3MDgwNjcyOQ==