From b55ec51e0e4a31d7769053eea49fa1b813155f8b Mon Sep 17 00:00:00 2001 From: teromene Date: Sun, 4 Nov 2018 21:50:18 +0100 Subject: [PATCH] Fix timestamp decoding --- bridges/FB2Bridge.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bridges/FB2Bridge.php b/bridges/FB2Bridge.php index fbd547c6..39ca1108 100644 --- a/bridges/FB2Bridge.php +++ b/bridges/FB2Bridge.php @@ -95,7 +95,8 @@ EOD; foreach($html->find('article') as $content) { $item = array(); - preg_match('/publish_time\\\":([0-9]+),/', $content->getAttribute('data-store', 0), $match); + //echo $content; die(); + preg_match('/publish_time\\\":([0-9]+),/', $content->getAttribute('data-store', 0), $match); if(isset($match[1])) $timestamp = $match[1]; else @@ -205,7 +206,9 @@ EOD; $regex = '/\\"html\\":(\".+\/div>"),"replace/'; preg_match($regex, $pageContent, $result); - $htmlContent = html_entity_decode(json_decode($result[1]), ENT_QUOTES, 'UTF-8'); + $htmlContent = json_decode($result[1]); + $htmlContent = preg_replace('/(?