mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-01-16 13:50:01 +01:00
fix: various notice fixes (#3718)
This commit is contained in:
parent
b9ec6a0eb4
commit
2172df9fa2
@ -260,7 +260,11 @@ class CodebergBridge extends BridgeAbstract
|
||||
}
|
||||
|
||||
$item['author'] = $div->find('a.author', 0)->innertext;
|
||||
$item['timestamp'] = $div->find('span.time-since', 0)->title;
|
||||
|
||||
$timeSince = $div->find('span.time-since', 0);
|
||||
if ($timeSince) {
|
||||
$item['timestamp'] = $timeSince->title;
|
||||
}
|
||||
|
||||
$this->items[] = $item;
|
||||
}
|
||||
|
@ -415,10 +415,14 @@ class CssSelectorComplexBridge extends BridgeAbstract
|
||||
) {
|
||||
$article_content = convertLazyLoading($entry_html);
|
||||
|
||||
$article_title = '';
|
||||
if (is_null($title_selector)) {
|
||||
$article_title = $title_default;
|
||||
} else {
|
||||
$article_title = trim($entry_html->find($title_selector, 0)->innertext);
|
||||
$titleElement = $entry_html->find($title_selector, 0);
|
||||
if ($titleElement) {
|
||||
$article_title = trim($titleElement->innertext);
|
||||
}
|
||||
}
|
||||
|
||||
$author = null;
|
||||
|
@ -244,7 +244,7 @@ HTML,
|
||||
if ($this->getInput('tagged')) {
|
||||
$types[] = 'Tags';
|
||||
}
|
||||
$typesText = $types[0];
|
||||
$typesText = $types[0] ?? '';
|
||||
if (count($types) > 1) {
|
||||
for ($i = 1; $i < count($types) - 1; $i++) {
|
||||
$typesText .= ', ' . $types[$i];
|
||||
|
@ -463,7 +463,7 @@ HEREDOC;
|
||||
)
|
||||
)->{'src'};
|
||||
} else {
|
||||
return $deal->find('img[class*=' . $selectorPlain . ']', 0)->src;
|
||||
return $deal->find('img[class*=' . $selectorPlain . ']', 0)->src ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,6 +65,7 @@ class ThePirateBayBridge extends BridgeAbstract
|
||||
'207' => 'HD Movies',
|
||||
'208' => 'HD TV-Shows',
|
||||
'209' => '3D',
|
||||
'210' => 'CAM/TS',
|
||||
'211' => 'UHD/4k Movies',
|
||||
'212' => 'UHD/4k TV-Shows',
|
||||
'299' => 'Other',
|
||||
|
@ -46,4 +46,14 @@ final class UtilsTest extends TestCase
|
||||
$this->assertSame(4, strlen(create_random_string(2)));
|
||||
$this->assertSame(6, strlen(create_random_string(3)));
|
||||
}
|
||||
|
||||
public function testUrljoin()
|
||||
{
|
||||
$base = '/';
|
||||
$rel = 'https://example.com/foo';
|
||||
|
||||
$url = urljoin($base, $rel);
|
||||
|
||||
$this->assertSame($rel, $url);
|
||||
}
|
||||
}
|
||||
|
5
vendor/php-urljoin/src/urljoin.php
vendored
5
vendor/php-urljoin/src/urljoin.php
vendored
@ -40,7 +40,10 @@ function urljoin($base, $rel) {
|
||||
}
|
||||
|
||||
if (isset($prel['scheme'])) {
|
||||
if ($prel['scheme'] != $pbase['scheme'] || in_array($prel['scheme'], $uses_relative) == false) {
|
||||
if (
|
||||
$prel['scheme'] != ($pbase['scheme'] ?? null)
|
||||
|| in_array($prel['scheme'], $uses_relative) == false
|
||||
) {
|
||||
return $rel;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user