mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-09-02 20:21:03 +02:00
drop BACKEND_RSS_TYPE from update_rss_feed, support detection of dc:subject as tags in Atom feeds
This commit is contained in:
parent
8fd2dc95ba
commit
be832a1a56
@ -488,8 +488,6 @@
|
|||||||
|
|
||||||
foreach ($iterator as $item) {
|
foreach ($iterator as $item) {
|
||||||
|
|
||||||
if (RSS_BACKEND_TYPE == "magpie") {
|
|
||||||
|
|
||||||
$entry_guid = $item["id"];
|
$entry_guid = $item["id"];
|
||||||
|
|
||||||
if (!$entry_guid) $entry_guid = $item["guid"];
|
if (!$entry_guid) $entry_guid = $item["guid"];
|
||||||
@ -573,6 +571,15 @@
|
|||||||
$num_comments = db_escape_string($item["slash"]["comments"]);
|
$num_comments = db_escape_string($item["slash"]["comments"]);
|
||||||
|
|
||||||
if (!$num_comments) $num_comments = 0;
|
if (!$num_comments) $num_comments = 0;
|
||||||
|
|
||||||
|
$dc_subject = $item['dc']['subject'];
|
||||||
|
|
||||||
|
$subject_tags = false;
|
||||||
|
|
||||||
|
if (is_array($dc_subject)) {
|
||||||
|
$subject_tags = $dc_subject;
|
||||||
|
} else if ($dc_subject) {
|
||||||
|
$subject_tags = array($dc_subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
# sanitize content
|
# sanitize content
|
||||||
@ -762,7 +769,15 @@
|
|||||||
$manual_tags = trim_array(split(",", $filter_param));
|
$manual_tags = trim_array(split(",", $filter_param));
|
||||||
|
|
||||||
foreach ($manual_tags as $tag) {
|
foreach ($manual_tags as $tag) {
|
||||||
if (!preg_match("/^[0-9]*$/", $tag) && $tag != '') {
|
if (tag_is_valid($tag)) {
|
||||||
|
array_push($entry_tags, $tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($subject_tags) {
|
||||||
|
foreach ($subject_tags as $tag) {
|
||||||
|
if (tag_is_valid($tag)) {
|
||||||
array_push($entry_tags, $tag);
|
array_push($entry_tags, $tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3112,4 +3127,8 @@
|
|||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function tag_is_valid($tag) {
|
||||||
|
return ($tag !='' && !preg_match("/^[0-9]*$/", $tag));
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user