1
0
mirror of https://github.com/RSS-Bridge/rss-bridge.git synced 2025-08-24 17:13:27 +02:00

bridges: Fix default return values and function scopes

getURI and getName should fall back to parent::getURI or
parent::getName respectively if it cannot build propper
return values.

Functions defined by bridges should be made private to
prevent confusion with inherited functions
This commit is contained in:
logmanoriginal
2016-12-17 16:39:18 +01:00
parent 271c71d0ac
commit 95b99d42a4
6 changed files with 34 additions and 19 deletions

View File

@@ -93,7 +93,7 @@ class FuturaSciencesBridge extends FeedExpander {
return $item;
}
function StripWithDelimiters($string, $start, $end) {
private function StripWithDelimiters($string, $start, $end) {
while (strpos($string, $start) !== false) {
$section_to_remove = substr($string, strpos($string, $start));
$section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));
@@ -101,7 +101,7 @@ class FuturaSciencesBridge extends FeedExpander {
} return $string;
}
function StripRecursiveHTMLSection($string, $tag_name, $tag_start) {
private function StripRecursiveHTMLSection($string, $tag_name, $tag_start) {
$open_tag = '<'.$tag_name;
$close_tag = '</'.$tag_name.'>';
$close_tag_length = strlen($close_tag);
@@ -125,7 +125,7 @@ class FuturaSciencesBridge extends FeedExpander {
return $string;
}
function ExtractArticleContent($article){
private function ExtractArticleContent($article){
$contents = $article->find('section[class=module article-text article-text-classic bg-white]', 0)->innertext;
foreach (array(
@@ -156,7 +156,7 @@ class FuturaSciencesBridge extends FeedExpander {
}
// Extracts the author from an article or element
function ExtractAuthor($article){
private function ExtractAuthor($article){
$article_author = $article->find('span.author', 0);
if($article_author){
return trim(str_replace(', Futura-Sciences', '', $article_author->plaintext));