From 9c78362fd7c8c423d6a255fdb227d8090a43db54 Mon Sep 17 00:00:00 2001 From: Teromene Date: Thu, 15 Jun 2017 11:51:11 +0100 Subject: [PATCH] Warn when accessing a private page. --- bridges/FB2Bridge.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php index 7c59383..779b48a 100644 --- a/bridges/FB2Bridge.php +++ b/bridges/FB2Bridge.php @@ -80,6 +80,11 @@ class FB2Bridge extends BridgeAbstract { if($pageID === null){ echo <<buildContent($fileContent); $author = $this->getInput('u'); - + foreach($html->find("article") as $content){ $item = array(); - + $item['uri'] = "http://touch.facebook.com" . $content->find("div[class='_52jc _5qc4 _24u0 _36xo']", 0)->find("a", 0)->getAttribute("href"); if($content->find("header", 0) !== null) { $content->find("header", 0)->innertext = ""; } - + if($content->find("footer", 0) !== null) { $content->find("footer", 0)->innertext = ""; } @@ -242,6 +247,10 @@ EOD; $pageContent = file_get_contents($page, 0, $context); + if(strpos($pageContent, "signup-button") != false) { + return -1; + } + //Get the page ID if we don't have a captcha $regex = "/page_id=([0-9]*)&/"; preg_match($regex, $pageContent, $matches);