Skip to content

Commit

Permalink
if title field does not exist look for text
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
  • Loading branch information
Grotax committed Dec 31, 2024
1 parent 22db637 commit 7f2a57f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ You can also check [on GitHub](https://github.com/nextcloud/news/releases), the
### Changed

### Fixed
- OPML import use text field for title if title field is missing (#3016)

# Releases
## [25.2.0-beta.1] - 2024-12-30
Expand Down
4 changes: 3 additions & 1 deletion lib/Utility/OPMLImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ public function import(string $userId, string $data): ?array
private function outlineToItem(DOMElement $outline, ?string $parent = null): void
{
if ($outline->getAttribute('type') === 'rss') {
// take title if available, otherwise use text #2896
$title = $outline->getAttribute('title') ?? $outline->getAttribute('text');
$feed = [
'link' => $outline->getAttribute('htmlUrl'),
'url' => $outline->getAttribute('xmlUrl'),
'title' => $outline->getAttribute('title'),
'title' => $title,
'folder' => $parent,
];

Expand Down

0 comments on commit 7f2a57f

Please sign in to comment.