From 18c6f0126fe0917500e6b5865fbe4037f2d30b45 Mon Sep 17 00:00:00 2001 From: Teromene Date: Thu, 15 Jun 2017 11:42:59 +0100 Subject: [PATCH] Fix FB2 bridge --- bridges/FB2Bridge.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php index b76b0bb0..7c593832 100644 --- a/bridges/FB2Bridge.php +++ b/bridges/FB2Bridge.php @@ -97,15 +97,21 @@ EOD; $html = $this->buildContent($fileContent); $author = $this->getInput('u'); - + foreach($html->find("article") as $content){ $item = array(); + $item['uri'] = "http://touch.facebook.com" - . $content->find("div._52jc", 0)->find("a", 0)->getAttribute("href"); + . $content->find("div[class='_52jc _5qc4 _24u0 _36xo']", 0)->find("a", 0)->getAttribute("href"); - $content->find("header", 0)->innertext = ""; - $content->find("footer", 0)->innertext = ""; + if($content->find("header", 0) !== null) { + $content->find("header", 0)->innertext = ""; + } + + if($content->find("footer", 0) !== null) { + $content->find("footer", 0)->innertext = ""; + } //Remove html nodes, keep only img, links, basic formatting $content = strip_tags($content, '

');