forked from GNUsocial/gnu-social
More robust pingback link detection
This commit is contained in:
parent
0ba53edd96
commit
a4a37d6fc9
@ -100,9 +100,9 @@ class LinkbackPlugin extends Plugin
|
|||||||
|
|
||||||
if (array_key_exists('X-Pingback', $result->headers)) {
|
if (array_key_exists('X-Pingback', $result->headers)) {
|
||||||
$pb = $result->headers['X-Pingback'];
|
$pb = $result->headers['X-Pingback'];
|
||||||
} else if (preg_match('/<link rel="pingback" href="([^"]+)" ?\/?>/',
|
|
||||||
$result->body,
|
} else if(preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]*\/?>/i', $result->body, $match)
|
||||||
$match)) {
|
|| preg_match('/<(?:link|a)[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]+href="([^"]+)"[ ]*\/?>/i', $result->body, $match)) {
|
||||||
$pb = $match[1];
|
$pb = $match[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user