From 88aae6fd9501f359b4ef4fc9c0cc224bebc47039 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Wed, 20 Mar 2019 17:59:16 +0100 Subject: [PATCH] core: Apply changes to fix broken Travis builds Travis-CI recently got updated, which causes existing builds to fail. For example: https://travis-ci.org/RSS-Bridge/rss-bridge/builds/507568117 Indenting multi-line arguments of functions fixes it. --- lib/contents.php | 36 +++++++++++++++++++----------------- lib/html.php | 7 ++++--- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/lib/contents.php b/lib/contents.php index 976ecbee..4740f5c2 100644 --- a/lib/contents.php +++ b/lib/contents.php @@ -207,14 +207,15 @@ EOD * @return string Contents as simplehtmldom object. */ function getSimpleHTMLDOM($url, -$header = array(), -$opts = array(), -$lowercase = true, -$forceTagsClosed = true, -$target_charset = DEFAULT_TARGET_CHARSET, -$stripRN = true, -$defaultBRText = DEFAULT_BR_TEXT, -$defaultSpanText = DEFAULT_SPAN_TEXT){ + $header = array(), + $opts = array(), + $lowercase = true, + $forceTagsClosed = true, + $target_charset = DEFAULT_TARGET_CHARSET, + $stripRN = true, + $defaultBRText = DEFAULT_BR_TEXT, + $defaultSpanText = DEFAULT_SPAN_TEXT){ + $content = getContents($url, $header, $opts); return str_get_html($content, $lowercase, @@ -256,15 +257,16 @@ $defaultSpanText = DEFAULT_SPAN_TEXT){ * @return string Contents as simplehtmldom object. */ function getSimpleHTMLDOMCached($url, -$duration = 86400, -$header = array(), -$opts = array(), -$lowercase = true, -$forceTagsClosed = true, -$target_charset = DEFAULT_TARGET_CHARSET, -$stripRN = true, -$defaultBRText = DEFAULT_BR_TEXT, -$defaultSpanText = DEFAULT_SPAN_TEXT){ + $duration = 86400, + $header = array(), + $opts = array(), + $lowercase = true, + $forceTagsClosed = true, + $target_charset = DEFAULT_TARGET_CHARSET, + $stripRN = true, + $defaultBRText = DEFAULT_BR_TEXT, + $defaultSpanText = DEFAULT_SPAN_TEXT){ + Debug::log('Caching url ' . $url . ', duration ' . $duration); // Initialize cache diff --git a/lib/html.php b/lib/html.php index e49ca7af..0778c640 100644 --- a/lib/html.php +++ b/lib/html.php @@ -26,9 +26,10 @@ * already removes some of the tags (search for `remove_noise` in simple_html_dom.php). */ function sanitize($html, -$tags_to_remove = array('script', 'iframe', 'input', 'form'), -$attributes_to_keep = array('title', 'href', 'src'), -$text_to_keep = array()){ + $tags_to_remove = array('script', 'iframe', 'input', 'form'), + $attributes_to_keep = array('title', 'href', 'src'), + $text_to_keep = array()){ + $htmlContent = str_get_html($html); /*