Revert "Use actual site root for webfinger discovery"

This reverts commit 7161cb4ebe.
This commit is contained in:
Jeremy Dormitzer 2018-11-20 22:36:12 -05:00
parent f94c1c9a52
commit b065fba502

View File

@ -41,15 +41,7 @@ function handle( $query ) {
}
$account_name = $matches[1];
$account_host = $matches[2];
$parsed = parse_url( site_url() );
$site_root = $parsed['host'];
if ( array_key_exists( 'port', $parsed ) && ! empty( $parsed['port'] ) ) {
$site_root = $site_root . ':' . $parsed['port'];
}
if ( array_key_exists( 'path', $parsed ) && ! empty( $parsed['path'] ) ) {
$site_root = $site_root . $parsed['path'];
}
if ( $account_host !== $site_root ) {
if ( $account_host !== $_SERVER['HTTP_HOST'] ) {
header( 'HTTP/1.1 404 Not Found', true, 404 );
echo __( 'Resource not found', 'pterotype' );
exit;