- $categories = $xpath->query('atom:category', $entry);
- if ($categories) {
- foreach ($categories as $category) {
- foreach ($category->attributes as $attributes) {
- if ($attributes->name == "term") {
- $term = $attributes->textContent;
- // don't add nsfw with content warning if enabled.
- // Background: "nsfw" is set automatically by Mastodon
- if (!Config::get('system', 'remove_nsfw_with_cw', false) ||
- !$content_warning || ($term != 'nsfw')) {
- if (strlen($item["tag"])) {
- $item["tag"] .= ',';
- }
- $item["tag"] .= "#[url=".System::baseUrl()."/search?tag=".$term."]".$term."[/url]";
- }
- }
- }
- }
- }
-