Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
feeds
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
feeds
Commits
06276604
Commit
06276604
authored
15 years ago
by
Alex Barth
Browse files
Options
Downloads
Patches
Plain Diff
#647128 bigkevmcd, Michelle: Fix broken author info in FeedsSyndicationParser.
parent
2b2aaeca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.txt
+1
-0
1 addition, 0 deletions
CHANGELOG.txt
libraries/common_syndication_parser.inc
+14
-4
14 additions, 4 deletions
libraries/common_syndication_parser.inc
with
15 additions
and
4 deletions
CHANGELOG.txt
+
1
−
0
View file @
06276604
...
...
@@ -3,6 +3,7 @@
Feeds 6.x 1.0 XXXXXXX, 20XX-XX-XX
---------------------------------
- #647128 bigkevmcd, Michelle: Fix broken author info in FeedsSyndicationParser.
- alex_b: Add mapping API for FeedsDataProcessor.
- alex_b: Decode HTML entities for title and author name in
FeedsSimplePieParser.
...
...
This diff is collapsed.
Click to expand it.
libraries/common_syndication_parser.inc
+
14
−
4
View file @
06276604
...
...
@@ -182,7 +182,7 @@ function _parser_common_syndication_atom10_parse($feed_XML) {
$item
=
array
();
$item
[
'title'
]
=
_parser_common_syndication_title
(
$title
,
$body
);
$item
[
'description'
]
=
$body
;
$item
[
'author'
]
=
$original_author
;
$item
[
'author
_name
'
]
=
$original_author
;
$item
[
'timestamp'
]
=
_parser_common_syndication_parse_date
(
isset
(
$news
->
published
)
?
"
{
$news
->
published
}
"
:
"
{
$news
->
issued
}
"
);
$item
[
'url'
]
=
trim
(
$original_url
);
if
(
valid_url
(
$item
[
'url'
])
&&
!
valid_url
(
$item
[
'url'
],
TRUE
)
&&
!
empty
(
$base
))
{
...
...
@@ -280,7 +280,7 @@ function _parser_common_syndication_RDF10_parse($feed_XML) {
// If no author name found, use the feed title:
if
(
empty
(
$item
[
'author'
]))
{
$item
[
'author'
]
=
$parsed_source
[
'title'
];
$item
[
'author
_name
'
]
=
$parsed_source
[
'title'
];
}
// If no GUID found, use the URL of the feed.
...
...
@@ -330,6 +330,12 @@ function _parser_common_syndication_RDF10_item($rdf_data, $mappings) {
* Parse RSS2.0 feeds.
*/
function
_parser_common_syndication_RSS20_parse
(
$feed_XML
)
{
$ns
=
array
(
"content"
=>
"http://purl.org/rss/1.0/modules/content/"
,
"dc"
=>
"http://purl.org/dc/elements/1.1/"
,
);
$parsed_source
=
array
();
// Detect the title.
$parsed_source
[
'title'
]
=
isset
(
$feed_XML
->
channel
->
title
)
?
_parser_common_syndication_title
(
"
{
$feed_XML
->
channel
->
title
}
"
)
:
""
;
...
...
@@ -343,7 +349,8 @@ function _parser_common_syndication_RSS20_parse($feed_XML) {
$category
=
$news
->
xpath
(
'category'
);
// Get children for current namespace.
if
(
version_compare
(
phpversion
(),
'5.1.2'
,
'>'
))
{
$content
=
(
array
)
$news
->
children
(
'http://purl.org/rss/1.0/modules/content/'
);
$content
=
(
array
)
$news
->
children
(
$ns
[
"content"
]);
$dc
=
(
array
)
$news
->
children
(
$ns
[
"dc"
]);
}
$news
=
(
array
)
$news
;
$news
[
'category'
]
=
$category
;
...
...
@@ -377,6 +384,9 @@ function _parser_common_syndication_RSS20_parse($feed_XML) {
if
(
!
empty
(
$news
[
'author'
]))
{
$original_author
=
"
{
$news
[
'author'
]
}
"
;
}
else
{
$original_author
=
(
string
)
$dc
[
"creator"
];
}
if
(
!
empty
(
$news
[
'link'
]))
{
$original_url
=
"
{
$news
[
'link'
]
}
"
;
...
...
@@ -414,7 +424,7 @@ function _parser_common_syndication_RSS20_parse($feed_XML) {
$item
=
array
();
$item
[
'title'
]
=
_parser_common_syndication_title
(
$title
,
$body
);
$item
[
'description'
]
=
$body
;
$item
[
'author'
]
=
$original_author
;
$item
[
'author
_name
'
]
=
$original_author
;
if
(
isset
(
$news
[
'pubDate'
]))
{
$item
[
'timestamp'
]
=
_parser_common_syndication_parse_date
(
$news
[
'pubDate'
]);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment