Skip to content

Commit

Permalink
Fix #8539: Special characters not parsed correctly in RSS output
Browse files Browse the repository at this point in the history
PHP's DOMDocument::createTextNode automatically escapes special
characters within the node value. Therefore we don't need to double
escape these special characters (in particular, the ampersand) using
string_rss_links(...) when PHP already does the escaping for us.

Use of DOMDocument::createCDATASection doesn't escape special characters
and thus we still need to use string_rss_links(...) to do our own
escaping of the description field.
  • Loading branch information
davidhicks committed Feb 8, 2010
1 parent c8e30df commit aa058c5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions issues_rss.php
Expand Up @@ -99,11 +99,11 @@

$encoding = 'utf-8';
$about = $t_path;
$title = string_rss_links( config_get( 'window_title' ) );
$title = config_get( 'window_title' );
$image_link = $t_path . 'images/mantis_logo_button.gif';

# only rss 2.0
$category = string_rss_links( project_get_name( $f_project_id ) );
$category = project_get_name( $f_project_id );
if ( $f_project_id !== 0 ) {
$title .= ' - ' . $category;
}
Expand Down Expand Up @@ -193,7 +193,7 @@
$t_bug = $t_issues[$i];

$about = $link = $t_path . "view.php?id=" . $t_bug->id;
$title = string_rss_links( bug_format_id( $t_bug->id ) . ': ' . $t_bug->summary );
$title = bug_format_id( $t_bug->id ) . ': ' . $t_bug->summary;

if ( $t_bug->view_state == VS_PRIVATE ) {
$title .= ' [' . lang_get( 'private' ) . ']';
Expand All @@ -202,20 +202,20 @@
$description = string_rss_links( $t_bug->description );

# subject is category.
$subject = string_rss_links( category_full_name( $t_bug->category_id, false ) );
$subject = category_full_name( $t_bug->category_id, false );

# optional DC value
$date = $t_bug->last_updated;

# author of item
$author = '';
if ( access_has_global_level( config_get( 'show_user_email_threshold' ) ) ) {
$t_author_name = string_rss_links( user_get_name( $t_bug->reporter_id ) );
$t_author_name = user_get_name( $t_bug->reporter_id );
$t_author_email = user_get_field( $t_bug->reporter_id, 'email' );

if ( !is_blank( $t_author_email ) ) {
if ( !is_blank( $t_author_name ) ) {
$author = $t_author_name . ' <' . $t_author_email . '>';
$author = $t_author_name . ' <' . $t_author_email . '>';
} else {
$author = $t_author_email;
}
Expand Down

0 comments on commit aa058c5

Please sign in to comment.