From: Stephen Paul Weber Date: Wed, 14 Oct 2015 20:28:38 +0000 (-0500) Subject: More robust pingback link detection X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a4a37d6fc9738c698c99cc8ee7ccaa454f6cc8e3;p=quix0rs-gnu-social.git More robust pingback link detection --- diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php index a710abd7bf..37c3ef8768 100644 --- a/plugins/Linkback/LinkbackPlugin.php +++ b/plugins/Linkback/LinkbackPlugin.php @@ -100,9 +100,9 @@ class LinkbackPlugin extends Plugin if (array_key_exists('X-Pingback', $result->headers)) { $pb = $result->headers['X-Pingback']; - } else if (preg_match('//', - $result->body, - $match)) { + + } else if(preg_match('/<(?:link|a)[ ]+href="([^"]+)"[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]*\/?>/i', $result->body, $match) + || preg_match('/<(?:link|a)[ ]+rel="[^" ]* ?pingback ?[^" ]*"[ ]+href="([^"]+)"[ ]*\/?>/i', $result->body, $match)) { $pb = $match[1]; }