- $name = substr($local, 0, strpos($local, '@'));
+ list($name, $host) = explode('@', $local);
+ }
+
+ if (!empty($host) && $host !== DI::baseUrl()->getHost()) {
+ DI::logger()->notice('Invalid host name for xrd query',['host' => $host, 'uri' => $uri]);
+ throw new NotFoundException('Invalid host name for xrd query: ' . $host);