if (array_key_exists('X-Pingback', $result->headers)) {
$pb = $result->headers['X-Pingback'];
- } else if (preg_match('/<link rel="pingback" href="([^"]+)" ?/?>/',
+ } else if (preg_match('/<link rel="pingback" href="([^"]+)" ?\/?>/',
$result->body,
$match)) {
$pb = $match[1];
}
- $tb = $this->getTrackback($result->body, $result->final_url);
-
- if (!empty($tb)) {
- $this->trackback($result->final_url, $tb);
- } else if (!empty($pb)) {
+ if (!empty($pb)) {
$this->pingback($result->final_url, $pb);
+ } else {
+ $tb = $this->getTrackback($result->body, $result->final_url);
+ if (!empty($tb)) {
+ $this->trackback($result->final_url, $tb);
+ }
}
return $orig;