Ticket #1181: full-rss-filters.patch
File full-rss-filters.patch, 5.7 KB (added by , 16 years ago) |
---|
-
bb-templates/kakumei/rss2.php
10 10 <channel> 11 11 <title><?php echo $title; ?></title> 12 12 <link><?php echo $link; ?></link> 13 <description>< ![CDATA[<?php echo $description; ?>]]></description>13 <description><?php echo $description; ?></description> 14 14 <language><?php esc_html( bb_option('language') ); ?></language> 15 15 <pubDate><?php echo gmdate('D, d M Y H:i:s +0000'); ?></pubDate> 16 16 <?php bb_generator( 'rss2' ); ?> -
bb-includes/defaults.bb-filters.php
115 115 function bb_filter_feed_content() 116 116 { 117 117 if ( bb_is_feed() ) { 118 add_filter( 'bb_title_rss', 'ent2ncr' ); 119 add_filter( 'topic_title', 'ent2ncr' ); 118 add_filter( 'bb_title_rss', 'strip_tags'); 119 add_filter( 'bb_title_rss', 'ent2ncr', 8); 120 add_filter( 'bb_title_rss', 'esc_html' ); 121 122 add_filter( 'bb_description_rss', 'strip_tags'); 123 add_filter( 'bb_description_rss', 'ent2ncr', 8 ); 124 add_filter( 'bb_description_rss', 'esc_html' ); 125 126 add_filter( 'post_author', 'ent2ncr', 8 ); 127 120 128 add_filter( 'post_link', 'esc_html' ); 129 130 add_filter( 'post_text', 'ent2ncr' ); 121 131 add_filter( 'post_text', 'htmlspecialchars' ); // encode_bad should not be overruled by esc_html 122 add_filter( 'post_text', 'ent2ncr' );123 132 } 124 133 } 125 134 add_action( 'bb_init', 'bb_filter_feed_content' ); -
rss.php
81 81 $posts[] = bb_get_first_post($topic->topic_id); 82 82 } 83 83 84 $title = esc_html( sprintf( __( '%1$s » View: %2$s' ), bb_get_option( 'name' ), $bb_views[$feed_id]['title'] ));84 $title = sprintf( __( '%1$s » View: %2$s' ), bb_get_option( 'name' ), $bb_views[$feed_id]['title'] ); 85 85 $link = get_view_link($feed_id); 86 86 $link_self = bb_get_view_rss_link($feed_id); 87 87 break; … … 91 91 die(); 92 92 if ( !$posts = get_thread( $feed_id, 0, 1 ) ) 93 93 die(); 94 $title = esc_html( sprintf( __( '%1$s » Topic: %2$s' ), bb_get_option( 'name' ), get_topic_title()) );94 $title = sprintf( __( '%1$s » Topic: %2$s' ), bb_get_option( 'name' ), get_topic_title() ); 95 95 $link = get_topic_link($feed_id); 96 96 $link_self = get_topic_rss_link($feed_id); 97 97 break; … … 108 108 if ( !$posts = get_user_favorites( $user->ID ) ) { 109 109 die(); 110 110 } 111 $title = esc_html( sprintf( __( '%1$s » User Favorites: %2$s' ), bb_get_option( 'name' ), $user->user_nicename ));111 $title = sprintf( __( '%1$s » User Favorites: %2$s' ), bb_get_option( 'name' ), $user->user_nicename ); 112 112 $link = bb_get_profile_link($feed_id); 113 113 $link_self = get_favorites_rss_link($feed_id); 114 114 break; … … 124 124 $posts[] = bb_get_first_post($topic->topic_id); 125 125 } 126 126 127 $title = esc_html( sprintf( __( '%1$s » Tag: %2$s - Recent Topics' ), bb_get_option( 'name' ), bb_get_tag_name()) );127 $title = sprintf( __( '%1$s » Tag: %2$s - Recent Topics' ), bb_get_option( 'name' ), bb_get_tag_name() ); 128 128 $link = bb_get_tag_link($feed_id); 129 129 $link_self = bb_get_tag_topics_rss_link($feed_id); 130 130 break; … … 134 134 die(); 135 135 if ( !$posts = get_tagged_topic_posts( array( 'tag_id' => $tag->tag_id, 'page' => 0 ) ) ) 136 136 die(); 137 $title = esc_html( sprintf( __( '%1$s » Tag: %2$s - Recent Posts' ), bb_get_option( 'name' ), bb_get_tag_name()) );137 $title = sprintf( __( '%1$s » Tag: %2$s - Recent Posts' ), bb_get_option( 'name' ), bb_get_tag_name() ); 138 138 $link = bb_get_tag_link($feed_id); 139 139 $link_self = bb_get_tag_posts_rss_link($feed_id); 140 140 break; … … 148 148 $posts[] = bb_get_first_post($topic->topic_id); 149 149 } 150 150 151 $title = esc_html( sprintf( __( '%1$s » Forum: %2$s - Recent Topics' ), bb_get_option( 'name' ), get_forum_name( $feed_id )) );151 $title = sprintf( __( '%1$s » Forum: %2$s - Recent Topics' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ); 152 152 $link = get_forum_link($feed_id); 153 153 $link_self = bb_get_forum_topics_rss_link($feed_id); 154 154 break; … … 156 156 case 'forum-posts': 157 157 if ( !$posts = bb_get_latest_forum_posts( $feed_id ) ) 158 158 die(); 159 $title = esc_html( sprintf( __( '%1$s » Forum: %2$s - Recent Posts' ), bb_get_option( 'name' ), get_forum_name( $feed_id )) );159 $title = sprintf( __( '%1$s » Forum: %2$s - Recent Posts' ), bb_get_option( 'name' ), get_forum_name( $feed_id ) ); 160 160 $link = get_forum_link($feed_id); 161 161 $link_self = bb_get_forum_posts_rss_link($feed_id); 162 162 break; … … 171 171 $posts[] = bb_get_first_post($topic->topic_id); 172 172 } 173 173 174 $title = esc_html( sprintf( __( '%1$s » Recent Topics' ), bb_get_option( 'name' )) );174 $title = sprintf( __( '%1$s » Recent Topics' ), bb_get_option( 'name' ) ); 175 175 $link = bb_get_uri(); 176 176 $link_self = bb_get_topics_rss_link(); 177 177 break; … … 181 181 default: 182 182 if ( !$posts = bb_get_latest_posts( 35 ) ) 183 183 die(); 184 $title = esc_html( sprintf( __( '%1$s » Recent Posts' ), bb_get_option( 'name' )) );184 $title = sprintf( __( '%1$s » Recent Posts' ), bb_get_option( 'name' ) ); 185 185 $link = bb_get_uri(); 186 186 $link_self = bb_get_posts_rss_link(); 187 187 break; … … 190 190 191 191 bb_send_304( $posts[0]->post_time ); 192 192 193 if (!$description = esc_html( bb_get_option('description') )) {193 if (!$description = bb_get_option( 'description' ) ) { 194 194 $description = $title; 195 195 } 196 196 $title = apply_filters( 'bb_title_rss', $title, $feed );