From a4a37d6fc9738c698c99cc8ee7ccaa454f6cc8e3 Mon Sep 17 00:00:00 2001 From: Stephen Paul Weber Date: Wed, 14 Oct 2015 15:28:38 -0500 Subject: [PATCH] More robust pingback link detection --- plugins/Linkback/LinkbackPlugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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]; } -- 2.39.5