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:----aKiSRgUTgEvsFLQ7snenf2wVYnsrbGvBipuBysctlJkjyHpX3/EFJEmN6dgXIBPDenj/eY8w7YEwViWTKA947rSV4LGceUZGuUwbBzj/eJ3WxoXXv6sE6sxGLMKD77RF6CnijuTNBUld7L0UO/ZKya+3lRSEhlRrhzlhFtLzZvzzd3+aQT1JrIk3la852AB5J7DK0Y25Q9a3qPIlzVI8SawmQCSKRyBmJcKVEb5zRFgMfIIOn3Em1arQPO+NepADYD//dLiMD/FWUp5bnxt3uarhdE/OQh9m8f8si1d93oBgmPn3VErVETYVIdVBD6BI0Kfi/JPE599rC9Vqrzfs91Hgf594RCFPsmumADe5gKi7OMTo8pydluzPHZnPRA5u8BkEIdVZqYpB68J5dDglUuDzzqqsMXmb/xmjUg1H73YfScq2i3d7YGMvqLMtEI/iWTo9XS/iLR/Rmau3GU6V695sbgbpueHzLojXnlMMtlmZicgIDFEED633vTj7R8EMVs1PX/qZ7LbD25nzGTKWhhgVyIjzODSa4ezv0XE5GFUcbaHqCpDeeKUDVcOGb/wGn83pA48KjGRzfwEHRg0H3HECLh6kFfSUq5wnGco3Zolgeh/4COxYyP34TyYgS4PPi6EIvWIIzEXUMb4VtiI6XERL4lnlLRxIUJzV21ttJus=----ATTACHMENT:----NDQ5MzA0NDE4ODk3NjUxMSAxNzQ5Mzc0NTg4ODQyMTcgMzEwMzM4MDg3MzU2MDMxNA==