From b4f1dc35a138718928120a13fe057cf9d01bb415 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Sun, 12 Feb 2017 13:58:42 +0100 Subject: [PATCH] [FB2Bridge] Split long lines Splits long lines into short sections without using string concatenation (.) to prevent errors due to coding styles. --- bridges/FB2Bridge.php | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php index fb68b67d..b76b0bb0 100644 --- a/bridges/FB2Bridge.php +++ b/bridges/FB2Bridge.php @@ -154,20 +154,37 @@ EOD; // Currently not used. Is used to get more than only 3 elements, as they appear on another page. private function computeNextLink($string, $pageID){ - $regex = "/timeline_unit\\\\\\\\u00253A1\\\\\\\\u00253A([0-9]*)\\\\\\\\u00253A([0-9]*)\\\\\\\\u00253A([0-9]*)\\\\\\\\u00253A([0-9]*)/"; + $regex = implode( + '', + array( + "/timeline_unit", + "\\\\\\\\u00253A1", + "\\\\\\\\u00253A([0-9]*)", + "\\\\\\\\u00253A([0-9]*)", + "\\\\\\\\u00253A([0-9]*)", + "\\\\\\\\u00253A([0-9]*)/" + ) + ); + preg_match($regex, $string, $result); - return "https://touch.facebook.com/pages_reaction_units/more/?page_id=" - . $pageID - . "&cursor=%7B%22timeline_cursor%22%3A%22timeline_unit%3A1%3A" - . $result[1] - . "%3A" - . $result[2] - . "%3A" - . $result[3] - . "%3A" - . $result[4] - . "%22%2C%22timeline_section_cursor%22%3A%7B%7D%2C%22has_next_page%22%3Atrue%7D&surface=mobile_page_home&unit_count=3"; + return implode( + '', + array( + "https://touch.facebook.com/pages_reaction_units/more/?page_id=", + $pageID, + "&cursor=%7B%22timeline_cursor%22%3A%22timeline_unit%3A1%3A", + $result[1], + "%3A", + $result[2], + "%3A", + $result[3], + "%3A", + $result[4], + "%22%2C%22timeline_section_cursor%22%3A%7B%7D%2C%22", + "has_next_page%22%3Atrue%7D&surface=mobile_page_home&unit_count=3" + ) + ); } //Builds the HTML from the encoded JS that Facebook provides.