Skip to content

Commit aab67e4

Browse files
committed
1 parent 3e55a4d commit aab67e4

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

includes/class-webmention-sender.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -264,15 +264,9 @@ public static function discover_endpoint( $url ) {
264264

265265
$xpath = new DOMXPath( $doc );
266266

267-
// check <link> elements
268-
// checks only head-links
269-
foreach ( $xpath->query( '//head/link[contains(concat(" ", @rel, " "), " webmention ") or contains(@rel, "webmention.org")]/@href' ) as $result ) {
270-
return WP_Http::make_absolute_url( $result->value, $url );
271-
}
272-
273-
// check <a> elements
267+
// check <link> and <a> elements
274268
// checks only body>a-links
275-
foreach ( $xpath->query( '//body//a[contains(concat(" ", @rel, " "), " webmention ") or contains(@rel, "webmention.org")]/@href' ) as $result ) {
269+
foreach ( $xpath->query( '(//link|//a)[contains(concat(" ", @rel, " "), " webmention ") or contains(@rel, "webmention.org")]/@href' ) as $result ) {
276270
return WP_Http::make_absolute_url( $result->value, $url );
277271
}
278272

0 commit comments

Comments
 (0)